Removed dbc and replaced with plain asserts everywhere.
This commit is contained in:
parent
767147c301
commit
adc192c6dc
17 changed files with 69 additions and 185 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "guecs/ui.hpp"
|
||||
#include <typeinfo>
|
||||
#include <cassert>
|
||||
#include <fmt/core.h>
|
||||
|
||||
namespace guecs {
|
||||
using std::make_shared;
|
||||
|
|
@ -23,7 +25,7 @@ namespace guecs {
|
|||
void UI::layout(const string& grid) {
|
||||
$grid = grid;
|
||||
bool good = $parser.parse($grid);
|
||||
dbc::check(good, "LEL parsing failed.");
|
||||
assert(good && "LEL parsing failed.");
|
||||
|
||||
for(auto& [name, cell] : $parser.cells) {
|
||||
auto ent = init_entity(name);
|
||||
|
|
@ -41,8 +43,8 @@ namespace guecs {
|
|||
}
|
||||
|
||||
Entity UI::entity(const string& name) {
|
||||
dbc::check($name_ents.contains(name),
|
||||
fmt::format("GUECS entity {} does not exist. Mispelled cell name?", name));
|
||||
assert($name_ents.contains(name) &&
|
||||
"GUECS entity does not exist. Mispelled cell name?");
|
||||
return $name_ents.at(name);
|
||||
}
|
||||
|
||||
|
|
@ -190,8 +192,8 @@ namespace guecs {
|
|||
auto ent = entity(name);
|
||||
|
||||
if(required) {
|
||||
dbc::check(has<Clickable>(ent),
|
||||
fmt::format("click_on required '{}' to exist but it doesn't", name));
|
||||
assert(has<Clickable>(ent) &&
|
||||
"click_on required '{}' to exist but it doesn't");
|
||||
}
|
||||
|
||||
click_on(ent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue