diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f67b6fe44..784b54c90 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -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 diff --git a/library/include/DFHack.h b/library/include/DFHack.h index d606df94b..8a094cf86 100644 --- a/library/include/DFHack.h +++ b/library/include/DFHack.h @@ -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" diff --git a/library/include/ModuleFactory.h b/library/include/ModuleFactory.h index 1f3d4222a..87c9a726f 100644 --- a/library/include/ModuleFactory.h +++ b/library/include/ModuleFactory.h @@ -33,7 +33,6 @@ namespace DFHack Module* createGui(); Module* createWorld(); Module* createMaterials(); - Module* createVegetation(); Module* createNotes(); Module* createGraphic(); } diff --git a/library/include/modules/Maps.h b/library/include/modules/Maps.h index 632e8ec13..82f79e94b 100644 --- a/library/include/modules/Maps.h +++ b/library/include/modules/Maps.h @@ -32,7 +32,6 @@ distribution. #include "Export.h" #include "Module.h" -#include "modules/Vegetation.h" #include #include "BitArray.h" #include "modules/Materials.h" diff --git a/library/include/modules/Vegetation.h b/library/include/modules/Vegetation.h deleted file mode 100644 index f293ec52c..000000000 --- a/library/include/modules/Vegetation.h +++ /dev/null @@ -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 diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index 363de8064..38f8bfb9f 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -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; diff --git a/library/modules/Vegetation.cpp b/library/modules/Vegetation.cpp deleted file mode 100644 index 9b14a3cc0..000000000 --- a/library/modules/Vegetation.cpp +++ /dev/null @@ -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 -#include -#include -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]; -} diff --git a/plugins/cleaners.cpp b/plugins/cleaners.cpp index 319b83c1f..1a52f8a17 100644 --- a/plugins/cleaners.cpp +++ b/plugins/cleaners.cpp @@ -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; diff --git a/plugins/devel/tiles.cpp b/plugins/devel/tiles.cpp index 1d30ca953..972b7fd0d 100644 --- a/plugins/devel/tiles.cpp +++ b/plugins/devel/tiles.cpp @@ -11,7 +11,6 @@ using std::string; #include #include #include -#include #include #include #include diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 56c8457cc..eaa8077f2 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -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 using std::string; diff --git a/plugins/liquids.cpp b/plugins/liquids.cpp index 6df530a92..15ae84c9b 100644 --- a/plugins/liquids.cpp +++ b/plugins/liquids.cpp @@ -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" diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp index 6bc2d6fb2..9d1ba1c1d 100644 --- a/plugins/mapexport/mapexport.cpp +++ b/plugins/mapexport/mapexport.cpp @@ -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" diff --git a/plugins/plants.cpp b/plugins/plants.cpp index 22e60c0d0..89a3257fa 100644 --- a/plugins/plants.cpp +++ b/plugins/plants.cpp @@ -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 & parameters); command_result df_immolate (color_ostream &out, vector & parameters); command_result df_extirpate (color_ostream &out, vector & parameters); @@ -219,7 +221,7 @@ command_result df_grow (color_ostream &out, vector & 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 & 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; } } } diff --git a/plugins/prospector.cpp b/plugins/prospector.cpp index 5eab897c0..efd457dfd 100644 --- a/plugins/prospector.cpp +++ b/plugins/prospector.cpp @@ -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; diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp index 6af94f2ee..a48b1a385 100644 --- a/plugins/tiletypes.cpp +++ b/plugins/tiletypes.cpp @@ -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"