summaryrefslogtreecommitdiff
path: root/plugins/seedwatch.cpp
diff options
context:
space:
mode:
authorQuietust2012-01-16 20:16:16 -0600
committerQuietust2012-01-16 20:16:16 -0600
commit64b55acf37519450f6feca5cda7d8fba2ee1e491 (patch)
treea135914d93b3472668e63f5ceac9c73bffc46076 /plugins/seedwatch.cpp
parent97bae19c13eb7f1b9ce651a0eae0a29a0e0b492b (diff)
downloaddfhack-64b55acf37519450f6feca5cda7d8fba2ee1e491.tar.gz
dfhack-64b55acf37519450f6feca5cda7d8fba2ee1e491.tar.bz2
dfhack-64b55acf37519450f6feca5cda7d8fba2ee1e491.tar.xz
df_item -> df::item, t_itemflags -> df::item_flags
Diffstat (limited to 'plugins/seedwatch.cpp')
-rwxr-xr-xplugins/seedwatch.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/plugins/seedwatch.cpp b/plugins/seedwatch.cpp
index 2d1a23b5..91da6813 100755
--- a/plugins/seedwatch.cpp
+++ b/plugins/seedwatch.cpp
@@ -13,6 +13,7 @@
#include "modules/World.h"
#include "modules/kitchen.h"
#include "VersionInfo.h"
+#include "df/item_flags.h"
using DFHack::t_materialType;
using DFHack::t_materialIndex;
@@ -23,19 +24,19 @@ bool running = false; // whether seedwatch is counting the seeds or not
// abbreviations for the standard plants
std::map<std::string, std::string> abbreviations;
-bool ignoreSeeds(DFHack::t_itemflags& f) // seeds with the following flags should not be counted
+bool ignoreSeeds(df::item_flags& f) // seeds with the following flags should not be counted
{
return
- f.dump ||
- f.forbid ||
- f.garbage_colect ||
- f.hidden ||
- f.hostile ||
- f.on_fire ||
- f.rotten ||
- f.trader ||
- f.in_building ||
- f.in_job;
+ f.bits.dump ||
+ f.bits.forbid ||
+ f.bits.garbage_colect ||
+ f.bits.hidden ||
+ f.bits.hostile ||
+ f.bits.on_fire ||
+ f.bits.rotten ||
+ f.bits.trader ||
+ f.bits.in_building ||
+ f.bits.in_job;
};
void printHelp(DFHack::Core& core) // prints help
@@ -329,9 +330,9 @@ DFhackCExport DFHack::command_result plugin_onupdate(DFHack::Core* pCore)
std::map<t_materialIndex, unsigned int> seedCount; // the number of seeds
DFHack::Items& itemsModule = *core.getItems();
itemsModule.Start();
- std::vector<DFHack::df_item*> items;
+ std::vector<df::item*> items;
itemsModule.readItemVector(items);
- DFHack::df_item * item;
+ df::item * item;
// count all seeds and plants by RAW material
for(std::size_t i = 0; i < items.size(); ++i)
{
@@ -339,10 +340,10 @@ DFhackCExport DFHack::command_result plugin_onupdate(DFHack::Core* pCore)
t_materialIndex materialIndex = item->getMaterialIndex();
switch(item->getType())
{
- case DFHack::Items::SEEDS:
+ case df::item_type::SEEDS:
if(!ignoreSeeds(item->flags)) ++seedCount[materialIndex];
break;
- case DFHack::Items::PLANT:
+ case df::item_type::PLANT:
break;
}
}