Brought over a bunch of code from the roguelike and now will use it to generate a random map.
This commit is contained in:
parent
8d3d3b4ec3
commit
2daa1c9bd5
59 changed files with 4303 additions and 411 deletions
24
devices.cpp
Normal file
24
devices.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "devices.hpp"
|
||||
#include "events.hpp"
|
||||
#include "dbc.hpp"
|
||||
|
||||
namespace components {
|
||||
|
||||
/*
|
||||
* Note: This should go away or at least the event names to
|
||||
* numbers should probably be automatically created.
|
||||
*/
|
||||
void Device::configure_events(json &event_names) {
|
||||
for(string name : event_names) {
|
||||
if(name == "Events::GUI::STAIRS_DOWN") {
|
||||
events.push_back(Events::GUI::STAIRS_DOWN);
|
||||
} else if(name == "Events::GUI::STAIRS_UP") {
|
||||
events.push_back(Events::GUI::STAIRS_UP);
|
||||
} else if(name == "Events::GUI::TRAP") {
|
||||
events.push_back(Events::GUI::TRAP);
|
||||
} else {
|
||||
dbc::sentinel(fmt::format("Unknown device event {}", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue