mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-25 12:57:08 +00:00
added elements in unit, map, game
This commit is contained in:
parent
220dd71d8f
commit
733bcbd99d
10 changed files with 116 additions and 16 deletions
|
|
@ -1,22 +1,36 @@
|
|||
#include <vector>
|
||||
#include "../game_map.hpp"
|
||||
#include "../game_events.hpp"
|
||||
#include "unit_module.hpp"
|
||||
#include "../map_entities/unit_obj.hpp"
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace unit {
|
||||
class Unit {
|
||||
private:
|
||||
const size_t MEMORY_SIZE = 100;
|
||||
|
||||
// parts of unit, that do something
|
||||
std::vector<Module> modules;
|
||||
|
||||
// memory, help modules communicate and handle events
|
||||
std::vector<int> memory;
|
||||
|
||||
map::UnitObj unitObj;
|
||||
|
||||
map::GameMap* map;
|
||||
public:
|
||||
Unit();
|
||||
|
||||
void update();
|
||||
events::EventCenter* eventCenter;
|
||||
public:
|
||||
Unit(map::GameMap* map, events::EventCenter* eventCenter);
|
||||
|
||||
void step();
|
||||
|
||||
size_t addModule(Module module);
|
||||
|
||||
void removeModule(size_t id);
|
||||
|
||||
void damage();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue