2021-11-14 14:19:13 +01:00
|
|
|
#ifndef BUILDING_MODEL_H
|
|
|
|
#define BUILDING_MODEL_H
|
|
|
|
|
|
|
|
#include "core/string.h"
|
|
|
|
#include "core/containers/vector.h"
|
|
|
|
|
|
|
|
#include "core/object.h"
|
2021-11-14 21:05:52 +01:00
|
|
|
#include "core/reference.h"
|
|
|
|
|
|
|
|
class Building;
|
|
|
|
class QueryResult;
|
2021-11-14 14:19:13 +01:00
|
|
|
|
|
|
|
class BuildingModel : public Object {
|
|
|
|
RCPP_OBJECT(BuildingModel, Object);
|
|
|
|
|
|
|
|
public:
|
2021-11-14 21:05:52 +01:00
|
|
|
virtual Ref<Building> get_building(const int id);
|
|
|
|
virtual Vector<Ref<Building> > get_all();
|
|
|
|
virtual void save_building(Ref<Building> &building);
|
2021-11-16 18:55:29 +01:00
|
|
|
|
2021-11-14 21:05:52 +01:00
|
|
|
virtual void parse_row(Ref<QueryResult> &result, Ref<Building> &building);
|
|
|
|
|
2021-11-14 14:19:13 +01:00
|
|
|
virtual void create_table();
|
|
|
|
virtual void drop_table();
|
|
|
|
virtual void migrate();
|
|
|
|
virtual void add_default_data();
|
|
|
|
|
|
|
|
static BuildingModel *get_singleton();
|
|
|
|
|
|
|
|
BuildingModel();
|
|
|
|
~BuildingModel();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static BuildingModel *_self;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|