ditch the unused Vegetation module

develop
jj 2012-12-06 23:46:59 +01:00
parent 885059c887
commit ebc2625d97
15 changed files with 10 additions and 120 deletions

@ -121,7 +121,6 @@ include/modules/Materials.h
include/modules/Notes.h
include/modules/Screen.h
include/modules/Translation.h
include/modules/Vegetation.h
include/modules/Vermin.h
include/modules/World.h
include/modules/Graphic.h
@ -142,7 +141,6 @@ modules/Materials.cpp
modules/Notes.cpp
modules/Screen.cpp
modules/Translation.cpp
modules/Vegetation.cpp
modules/Vermin.cpp
modules/World.cpp
modules/Graphic.cpp

@ -61,7 +61,6 @@ distribution.
#include "modules/Translation.h"
#include "modules/World.h"
#include "modules/Items.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"

@ -33,7 +33,6 @@ namespace DFHack
Module* createGui();
Module* createWorld();
Module* createMaterials();
Module* createVegetation();
Module* createNotes();
Module* createGraphic();
}

@ -32,7 +32,6 @@ distribution.
#include "Export.h"
#include "Module.h"
#include "modules/Vegetation.h"
#include <vector>
#include "BitArray.h"
#include "modules/Materials.h"

@ -1,48 +0,0 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2012 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once
#ifndef CL_MOD_VEGETATION
#define CL_MOD_VEGETATION
/**
* \defgroup grp_vegetation Vegetation : stuff that grows and gets cut down or trampled by dwarves
* @ingroup grp_modules
*/
#include "Export.h"
#include "DataDefs.h"
#include "df/plant.h"
namespace DFHack
{
namespace Vegetation
{
const uint32_t sapling_to_tree_threshold = 120 * 28 * 12 * 3; // 3 years
DFHACK_EXPORT bool isValid();
DFHACK_EXPORT uint32_t getCount();
DFHACK_EXPORT df::plant * getPlant(const int32_t index);
}
}
#endif

@ -59,6 +59,7 @@ using namespace std;
#include "df/z_level_flags.h"
#include "df/region_map_entry.h"
#include "df/flow_info.h"
#include "df/plant.h"
using namespace DFHack;
using namespace df::enums;

@ -1,60 +0,0 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2012 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "Internal.h"
#include <string>
#include <vector>
#include <map>
using namespace std;
#include "VersionInfo.h"
#include "MemAccess.h"
#include "Types.h"
#include "Core.h"
using namespace DFHack;
#include "modules/Vegetation.h"
#include "df/world.h"
using namespace DFHack;
using df::global::world;
bool Vegetation::isValid()
{
return (world != NULL);
}
uint32_t Vegetation::getCount()
{
return world->plants.all.size();
}
df::plant * Vegetation::getPlant(const int32_t index)
{
if (uint32_t(index) >= getCount())
return NULL;
return world->plants.all[index];
}

@ -12,6 +12,7 @@
#include "df/global_objects.h"
#include "df/builtin_mats.h"
#include "df/contaminant.h"
#include "df/plant.h"
using std::vector;
using std::string;

@ -11,7 +11,6 @@ using std::string;
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Vegetation.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <TileTypes.h>

@ -11,8 +11,8 @@
#include "df/map_block.h"
#include "df/tile_dig_designation.h"
#include "df/plant_raw.h"
#include "df/plant.h"
#include "modules/Vegetation.h"
#include <set>
using std::string;

@ -37,7 +37,6 @@ using std::set;
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"

@ -13,6 +13,7 @@ using namespace google::protobuf::io;
#include "DataDefs.h"
#include "df/world.h"
#include "df/plant.h"
#include "modules/Constructions.h"
#include "proto/Map.pb.h"

@ -9,17 +9,19 @@
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"
#include "modules/MapCache.h"
#include "df/plant.h"
using std::vector;
using std::string;
using namespace DFHack;
using df::global::world;
const uint32_t sapling_to_tree_threshold = 120 * 28 * 12 * 3; // 3 years
command_result df_grow (color_ostream &out, vector <string> & parameters);
command_result df_immolate (color_ostream &out, vector <string> & parameters);
command_result df_extirpate (color_ostream &out, vector <string> & parameters);
@ -219,7 +221,7 @@ command_result df_grow (color_ostream &out, vector <string> & parameters)
if(tileShape(map.tiletypeAt(DFCoord(x,y,z))) == tiletype_shape::SAPLING &&
tileSpecial(map.tiletypeAt(DFCoord(x,y,z))) != tiletype_special::DEAD)
{
tree->grow_counter = Vegetation::sapling_to_tree_threshold;
tree->grow_counter = sapling_to_tree_threshold;
}
break;
}
@ -235,7 +237,7 @@ command_result df_grow (color_ostream &out, vector <string> & parameters)
df::tiletype ttype = map.tiletypeAt(df::coord(p->pos.x,p->pos.y,p->pos.z));
if(!p->flags.bits.is_shrub && tileShape(ttype) == tiletype_shape::SAPLING && tileSpecial(ttype) != tiletype_special::DEAD)
{
p->grow_counter = Vegetation::sapling_to_tree_threshold;
p->grow_counter = sapling_to_tree_threshold;
}
}
}

@ -33,6 +33,7 @@ using namespace std;
#include "df/region_map_entry.h"
#include "df/inclusion_type.h"
#include "df/viewscreen_choose_start_sitest.h"
#include "df/plant.h"
using namespace DFHack;
using namespace df::enums;

@ -34,7 +34,6 @@ using std::set;
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"