mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-05 00:08:15 +00:00
develop classes
This commit is contained in:
parent
9be0f50790
commit
580ef8ac3c
15 changed files with 62 additions and 22 deletions
|
|
@ -1,14 +1,16 @@
|
|||
#include <string>
|
||||
#include "unit_module.hpp"
|
||||
|
||||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
class ModuleBuilder {
|
||||
private:
|
||||
public:
|
||||
ModuleBuilder();
|
||||
|
||||
Module create();
|
||||
|
||||
void config(const std::string& file);
|
||||
};
|
||||
}
|
||||
|
|
@ -1 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
// include all modules from folder
|
||||
|
|
@ -1,15 +1,19 @@
|
|||
#include <vector>
|
||||
#include "../game_map.hpp"
|
||||
#include "unit_module.hpp"
|
||||
#include "unit_memory_elem.hpp"
|
||||
|
||||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
class Unit {
|
||||
private:
|
||||
std::vector<Module> modules;
|
||||
std::vector<MemoryElem> memory;
|
||||
map::GameMap map;
|
||||
public:
|
||||
Unit();
|
||||
|
||||
void update();
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
#include "unit_builder.hpp"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#include <string>
|
||||
#include "unit.hpp"
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
class UnitBuilder {
|
||||
private:
|
||||
public:
|
||||
UnitBuilder();
|
||||
|
||||
Unit create();
|
||||
|
||||
void config(std::string& file);
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
struct MemoryElem {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// #include "unit.hpp" // ??
|
||||
|
||||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
class Module {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue