Trying out Ragel's state machine generation as an alternative to the DinkyFSM style.
This commit is contained in:
parent
9468990f76
commit
7fc32b0248
10 changed files with 428 additions and 19 deletions
|
@ -140,6 +140,7 @@ void System::motion(GameLevel &level) {
|
|||
}
|
||||
|
||||
void System::distribute_loot(DinkyECS::World &world, DinkyECS::Entity& ent, nlohmann::json& entity_data) {
|
||||
dbc::log("!!!!!!!!!!!!! THIS is where you update the dead body contents");
|
||||
int inventory_count = entity_data["inventory_count"];
|
||||
world.set<InventoryItem>(ent, {inventory_count, entity_data});
|
||||
// use the inventory_level to fill the blanket with new items
|
||||
|
@ -209,6 +210,7 @@ void System::death(GameLevel &level) {
|
|||
auto entity_data = config.devices["GRAVE_STONE"];
|
||||
components::configure_entity(world, ent, entity_data["components"]);
|
||||
if(entity_data["inventory_count"] > 0) {
|
||||
dbc::sentinel("BOOM! this is where you fill in the dead bodies.");
|
||||
System::distribute_loot(world, ent, entity_data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue