diff --git a/library/Core.cpp b/library/Core.cpp index 81dafdd76..cb33ceb21 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -65,6 +65,7 @@ using namespace DFHack; using namespace tthread; using namespace df::enums; +using df::global::init; struct Core::Cond { @@ -630,7 +631,7 @@ bool Core::Init() // init the console. Gui * g = getGui(); bool is_text_mode = false; - if(df::global::init && df::global::init->display.flag.is_set(df::enums::init_display_flags::TEXT)) + if(init && init->display.flag.is_set(init_display_flags::TEXT)) { is_text_mode = true; } diff --git a/library/include/df/custom/inorganic_raw.methods.inc b/library/include/df/custom/inorganic_raw.methods.inc index 3b324292a..0e8a62e78 100644 --- a/library/include/df/custom/inorganic_raw.methods.inc +++ b/library/include/df/custom/inorganic_raw.methods.inc @@ -1,4 +1,4 @@ bool isOre() { - return flags.is_set(df::inorganic_flags::METAL_ORE) || flags.is_set(df::inorganic_flags::THREAD_METAL); + return flags.is_set(df::enums::inorganic_flags::METAL_ORE) || flags.is_set(df::enums::inorganic_flags::THREAD_METAL); } \ No newline at end of file diff --git a/library/include/df/custom/material.methods.inc b/library/include/df/custom/material.methods.inc index 4dbc1753b..52f4d73c2 100644 --- a/library/include/df/custom/material.methods.inc +++ b/library/include/df/custom/material.methods.inc @@ -1,8 +1,8 @@ bool isGem() { - return flags.is_set(df::material_flags::IS_GEM); + return flags.is_set(df::enums::material_flags::IS_GEM); } bool isStone() { - return flags.is_set(df::material_flags::IS_STONE); + return flags.is_set(df::enums::material_flags::IS_STONE); } diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index d0ab9e022..080c53c1b 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -430,7 +430,7 @@ int32_t Items::getItemOwnerID(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::UNIT_ITEMOWNER) + if (ref->getType() == general_ref_type::UNIT_ITEMOWNER) return ref->getID(); } return -1; @@ -441,7 +441,7 @@ df::unit *Items::getItemOwner(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::UNIT_ITEMOWNER) + if (ref->getType() == general_ref_type::UNIT_ITEMOWNER) return ref->getUnit(); } return NULL; @@ -452,7 +452,7 @@ int32_t Items::getItemContainerID(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::CONTAINED_IN_ITEM) + if (ref->getType() == general_ref_type::CONTAINED_IN_ITEM) return ref->getID(); } return -1; @@ -463,7 +463,7 @@ df::item *Items::getItemContainer(const df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::CONTAINED_IN_ITEM) + if (ref->getType() == general_ref_type::CONTAINED_IN_ITEM) return ref->getItem(); } return NULL; @@ -471,7 +471,7 @@ df::item *Items::getItemContainer(const df::item * item) bool Items::getContainedItems(const df::item * item, std::vector &items) { - return readItemRefs(item, df::general_ref_type::CONTAINS_ITEM, items); + return readItemRefs(item, general_ref_type::CONTAINS_ITEM, items); } bool Items::readItemRefs(const df::item * item, df::general_ref_type type, std::vector &values) @@ -493,7 +493,7 @@ bool Items::removeItemOwner(df::item * item) for (uint32_t i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() != df::general_ref_type::UNIT_ITEMOWNER) + if (ref->getType() != general_ref_type::UNIT_ITEMOWNER) continue; df::unit *unit = ref->getUnit(); diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index 928565b97..87fef0f9e 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -48,31 +48,32 @@ using namespace std; using namespace DFHack; using namespace DFHack::Simple; +using namespace df::enums; using df::global::world; const char * DFHack::sa_feature(df::feature_type index) { switch(index) { - case df::feature_type::outdoor_river: + case feature_type::outdoor_river: return "River"; - case df::feature_type::cave: + case feature_type::cave: return "Cave"; - case df::feature_type::pit: + case feature_type::pit: return "Pit"; - case df::feature_type::magma_pool: + case feature_type::magma_pool: return "Magma pool"; - case df::feature_type::volcano: + case feature_type::volcano: return "Volcano"; - case df::feature_type::deep_special_tube: + case feature_type::deep_special_tube: return "Adamantine deposit"; - case df::feature_type::deep_surface_portal: + case feature_type::deep_surface_portal: return "Underworld portal"; - case df::feature_type::subterranean_from_layer: + case feature_type::subterranean_from_layer: return "Cavern"; - case df::feature_type::magma_core_from_layer: + case feature_type::magma_core_from_layer: return "Magma sea"; - case df::feature_type::feature_underworld_from_layer: + case feature_type::feature_underworld_from_layer: return "Underworld"; default: return "Unknown/Error"; @@ -184,7 +185,7 @@ bool Maps::ReadDirtyBit(uint32_t x, uint32_t y, uint32_t z, bool &dirtybit) df::map_block *block = getBlock(x,y,z); if (block) { - dirtybit = block->flags.is_set(df::block_flags::Designated); + dirtybit = block->flags.is_set(block_flags::Designated); return true; } return false; @@ -195,7 +196,7 @@ bool Maps::WriteDirtyBit(uint32_t x, uint32_t y, uint32_t z, bool dirtybit) df::map_block *block = getBlock(x,y,z); if (block) { - block->flags.set(df::block_flags::Designated, dirtybit); + block->flags.set(block_flags::Designated, dirtybit); return true; } return false; @@ -475,7 +476,7 @@ bool Maps::SortBlockEvents(uint32_t x, uint32_t y, uint32_t z, vector * veins, vector * ices, vector *splatter, - vector *grass, + vector *grasses, vector *constructions) { if (veins) @@ -484,8 +485,8 @@ bool Maps::SortBlockEvents(uint32_t x, uint32_t y, uint32_t z, ices->clear(); if (splatter) splatter->clear(); - if (grass) - grass->clear(); + if (grasses) + grasses->clear(); if (constructions) constructions->clear(); @@ -500,23 +501,23 @@ bool Maps::SortBlockEvents(uint32_t x, uint32_t y, uint32_t z, df::block_square_event *evt = block->block_events[i]; switch (evt->getType()) { - case df::block_square_event_type::mineral: + case block_square_event_type::mineral: if (veins) veins->push_back((df::block_square_event_mineralst *)evt); break; - case df::block_square_event_type::frozen_liquid: + case block_square_event_type::frozen_liquid: if (ices) ices->push_back((df::block_square_event_frozen_liquidst *)evt); break; - case df::block_square_event_type::material_spatter: + case block_square_event_type::material_spatter: if (splatter) splatter->push_back((df::block_square_event_material_spatterst *)evt); break; - case df::block_square_event_type::grass: - if (grass) - grass->push_back((df::block_square_event_grassst *)evt); + case block_square_event_type::grass: + if (grasses) + grasses->push_back((df::block_square_event_grassst *)evt); break; - case df::block_square_event_type::world_construction: + case block_square_event_type::world_construction: if (constructions) constructions->push_back((df::block_square_event_world_constructionst *)evt); break; diff --git a/library/modules/Materials.cpp b/library/modules/Materials.cpp index 48195aac2..3950a05f1 100644 --- a/library/modules/Materials.cpp +++ b/library/modules/Materials.cpp @@ -781,26 +781,26 @@ bool Materials::ReadCreatureTypesEx (void) for (int32_t k = 0; k < 7; k++) { - caste.strength[k] = ca->attributes.phys_att_range[df::physical_attribute_type::STRENGTH][k]; - caste.agility[k] = ca->attributes.phys_att_range[df::physical_attribute_type::AGILITY][k]; - caste.toughness[k] = ca->attributes.phys_att_range[df::physical_attribute_type::TOUGHNESS][k]; - caste.endurance[k] = ca->attributes.phys_att_range[df::physical_attribute_type::ENDURANCE][k]; - caste.recuperation[k] = ca->attributes.phys_att_range[df::physical_attribute_type::RECUPERATION][k]; - caste.disease_resistance[k] = ca->attributes.phys_att_range[df::physical_attribute_type::DISEASE_RESISTANCE][k]; - - caste.analytical_ability[k] = ca->attributes.phys_att_range[df::mental_attribute_type::ANALYTICAL_ABILITY][k]; - caste.focus[k] = ca->attributes.phys_att_range[df::mental_attribute_type::FOCUS][k]; - caste.willpower[k] = ca->attributes.phys_att_range[df::mental_attribute_type::WILLPOWER][k]; - caste.creativity[k] = ca->attributes.phys_att_range[df::mental_attribute_type::CREATIVITY][k]; - caste.intuition[k] = ca->attributes.phys_att_range[df::mental_attribute_type::INTUITION][k]; - caste.patience[k] = ca->attributes.phys_att_range[df::mental_attribute_type::PATIENCE][k]; - caste.memory[k] = ca->attributes.phys_att_range[df::mental_attribute_type::MEMORY][k]; - caste.linguistic_ability[k] = ca->attributes.phys_att_range[df::mental_attribute_type::LINGUISTIC_ABILITY][k]; - caste.spatial_sense[k] = ca->attributes.phys_att_range[df::mental_attribute_type::SPATIAL_SENSE][k]; - caste.musicality[k] = ca->attributes.phys_att_range[df::mental_attribute_type::MUSICALITY][k]; - caste.kinesthetic_sense[k] = ca->attributes.phys_att_range[df::mental_attribute_type::KINESTHETIC_SENSE][k]; - caste.empathy[k] = ca->attributes.phys_att_range[df::mental_attribute_type::EMPATHY][k]; - caste.social_awareness[k] = ca->attributes.phys_att_range[df::mental_attribute_type::SOCIAL_AWARENESS][k]; + caste.strength[k] = ca->attributes.phys_att_range[physical_attribute_type::STRENGTH][k]; + caste.agility[k] = ca->attributes.phys_att_range[physical_attribute_type::AGILITY][k]; + caste.toughness[k] = ca->attributes.phys_att_range[physical_attribute_type::TOUGHNESS][k]; + caste.endurance[k] = ca->attributes.phys_att_range[physical_attribute_type::ENDURANCE][k]; + caste.recuperation[k] = ca->attributes.phys_att_range[physical_attribute_type::RECUPERATION][k]; + caste.disease_resistance[k] = ca->attributes.phys_att_range[physical_attribute_type::DISEASE_RESISTANCE][k]; + + caste.analytical_ability[k] = ca->attributes.phys_att_range[mental_attribute_type::ANALYTICAL_ABILITY][k]; + caste.focus[k] = ca->attributes.phys_att_range[mental_attribute_type::FOCUS][k]; + caste.willpower[k] = ca->attributes.phys_att_range[mental_attribute_type::WILLPOWER][k]; + caste.creativity[k] = ca->attributes.phys_att_range[mental_attribute_type::CREATIVITY][k]; + caste.intuition[k] = ca->attributes.phys_att_range[mental_attribute_type::INTUITION][k]; + caste.patience[k] = ca->attributes.phys_att_range[mental_attribute_type::PATIENCE][k]; + caste.memory[k] = ca->attributes.phys_att_range[mental_attribute_type::MEMORY][k]; + caste.linguistic_ability[k] = ca->attributes.phys_att_range[mental_attribute_type::LINGUISTIC_ABILITY][k]; + caste.spatial_sense[k] = ca->attributes.phys_att_range[mental_attribute_type::SPATIAL_SENSE][k]; + caste.musicality[k] = ca->attributes.phys_att_range[mental_attribute_type::MUSICALITY][k]; + caste.kinesthetic_sense[k] = ca->attributes.phys_att_range[mental_attribute_type::KINESTHETIC_SENSE][k]; + caste.empathy[k] = ca->attributes.phys_att_range[mental_attribute_type::EMPATHY][k]; + caste.social_awareness[k] = ca->attributes.phys_att_range[mental_attribute_type::SOCIAL_AWARENESS][k]; } mat.castes.push_back(caste); } diff --git a/library/modules/kitchen.cpp b/library/modules/kitchen.cpp index 3a85b3926..e2b26b082 100644 --- a/library/modules/kitchen.cpp +++ b/library/modules/kitchen.cpp @@ -57,7 +57,7 @@ void Kitchen::allowPlantSeedCookery(t_materialIndex materialIndex) for(std::size_t i = 0; i < size(); ++i) { if(ui->kitchen.mat_indices[i] == materialIndex - && (ui->kitchen.item_types[i] == df::item_type::SEEDS || ui->kitchen.item_types[i] == df::item_type::PLANT) + && (ui->kitchen.item_types[i] == item_type::SEEDS || ui->kitchen.item_types[i] == item_type::PLANT) && ui->kitchen.exc_types[i] == cookingExclusion ) { @@ -86,15 +86,15 @@ void Kitchen::denyPlantSeedCookery(t_materialIndex materialIndex) if(ui->kitchen.mat_indices[i] == materialIndex && ui->kitchen.exc_types[i] == cookingExclusion) { - if(ui->kitchen.item_types[i] == df::item_type::SEEDS) + if(ui->kitchen.item_types[i] == item_type::SEEDS) SeedAlreadyIn = true; - else if (ui->kitchen.item_types[i] == df::item_type::PLANT) + else if (ui->kitchen.item_types[i] == item_type::PLANT) PlantAlreadyIn = true; } } if(!SeedAlreadyIn) { - ui->kitchen.item_types.push_back(df::item_type::SEEDS); + ui->kitchen.item_types.push_back(item_type::SEEDS); ui->kitchen.item_subtypes.push_back(organicSubtype); ui->kitchen.mat_types.push_back(type->material_defs.type_seed); ui->kitchen.mat_indices.push_back(materialIndex); @@ -102,7 +102,7 @@ void Kitchen::denyPlantSeedCookery(t_materialIndex materialIndex) } if(!PlantAlreadyIn) { - ui->kitchen.item_types.push_back(df::item_type::PLANT); + ui->kitchen.item_types.push_back(item_type::PLANT); ui->kitchen.item_subtypes.push_back(organicSubtype); ui->kitchen.mat_types.push_back(type->material_defs.type_basic_mat); ui->kitchen.mat_indices.push_back(materialIndex); diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 0213e460a..947d6c5dd 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -984,7 +984,7 @@ static void dryBucket(df::item *item) for (unsigned i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::CONTAINS_ITEM) + if (ref->getType() == general_ref_type::CONTAINS_ITEM) { df::item *obj = ref->getItem(); @@ -1006,20 +1006,20 @@ static bool itemBusy(df::item *item) for (unsigned i = 0; i < item->itemrefs.size(); i++) { df::general_ref *ref = item->itemrefs[i]; - if (ref->getType() == df::general_ref_type::CONTAINS_ITEM) + if (ref->getType() == general_ref_type::CONTAINS_ITEM) { df::item *obj = ref->getItem(); if (obj && !obj->flags.bits.garbage_colect) return true; } - else if (ref->getType() == df::general_ref_type::CONTAINS_UNIT) + else if (ref->getType() == general_ref_type::CONTAINS_UNIT) return true; - else if (ref->getType() == df::general_ref_type::UNIT_HOLDER) + else if (ref->getType() == general_ref_type::UNIT_HOLDER) { if (!item->flags.bits.in_job) return true; } - else if (ref->getType() == df::general_ref_type::CONTAINED_IN_ITEM) + else if (ref->getType() == general_ref_type::CONTAINED_IN_ITEM) { df::item *obj = ref->getItem(); if (!obj)