Removed dbc and replaced with plain asserts everywhere.

This commit is contained in:
Zed A. Shaw 2025-05-10 10:53:53 -04:00
parent 767147c301
commit adc192c6dc
17 changed files with 69 additions and 185 deletions

View file

@ -1,50 +0,0 @@
#pragma once
#include <string>
#include <fmt/core.h>
#include <functional>
#include <source_location>
using std::string;
namespace dbc {
class Error {
public:
const string message;
Error(string m) : message{m} {}
Error(const char *m) : message{m} {}
};
class CheckError : public Error {};
class SentinelError : public Error {};
class PreCondError : public Error {};
class PostCondError : public Error {};
void log(const string &message,
const std::source_location location =
std::source_location::current());
[[noreturn]] void sentinel(const string &message,
const std::source_location location =
std::source_location::current());
void pre(const string &message, bool test,
const std::source_location location =
std::source_location::current());
void pre(const string &message, std::function<bool()> tester,
const std::source_location location =
std::source_location::current());
void post(const string &message, bool test,
const std::source_location location =
std::source_location::current());
void post(const string &message, std::function<bool()> tester,
const std::source_location location =
std::source_location::current());
void check(bool test, const string &message,
const std::source_location location =
std::source_location::current());
}

View file

@ -1,6 +1,8 @@
#include "guecs/ui.hpp"
namespace sfml {
using std::string;
class Backend : public guecs::Backend {
int $shaders_version = 0;

View file

@ -1,6 +1,5 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "guecs/dbc.hpp"
#include "guecs/lel.hpp"
#include <string>
#include <memory>

View file

@ -1,5 +1,4 @@
#pragma once
#include "guecs/dbc.hpp"
#include "guecs/lel.hpp"
#include <string>
#include <memory>
@ -10,6 +9,7 @@
#include <unordered_map>
#include "guecs/theme.hpp"
#include "guecs/sfml/components.hpp"
#include <cassert>
namespace guecs {
using std::shared_ptr, std::wstring, std::string;
@ -177,7 +177,7 @@ namespace guecs {
template <typename Comp>
void set_init(Entity ent, Comp val) {
dbc::check(has<lel::Cell>(ent),"WRONG! slot is missing its cell?!");
assert(has<lel::Cell>(ent) && "WRONG! slot is missing its cell?!");
auto& cell = get<lel::Cell>(ent);
val.init(cell);
set<Comp>(ent, val);