rts_game_backend/src/game/unit/unit.hpp

37 lines
755 B
C++
Raw Normal View History

2021-03-22 19:37:34 +03:00
#include <vector>
2021-03-24 20:31:44 +03:00
#include "../game_map.hpp"
2021-04-12 01:51:12 +03:00
#include "../game_events.hpp"
2021-03-22 19:37:34 +03:00
#include "unit_module.hpp"
2021-04-12 01:51:12 +03:00
#include "../map_entities/unit_obj.hpp"
2021-03-22 19:37:34 +03:00
2021-03-24 20:31:44 +03:00
#pragma once
2021-03-22 19:37:34 +03:00
namespace unit {
class Unit {
private:
2021-04-12 01:51:12 +03:00
const size_t MEMORY_SIZE = 100;
2021-04-11 12:45:39 +03:00
// parts of unit, that do something
2021-03-22 19:37:34 +03:00
std::vector<Module> modules;
2021-04-11 12:45:39 +03:00
// memory, help modules communicate and handle events
std::vector<int> memory;
2021-04-12 01:51:12 +03:00
map::UnitObj unitObj;
2021-04-11 12:45:39 +03:00
map::GameMap* map;
2021-04-12 01:51:12 +03:00
events::EventCenter* eventCenter;
2021-03-22 19:37:34 +03:00
public:
2021-04-12 01:51:12 +03:00
Unit(map::GameMap* map, events::EventCenter* eventCenter);
void step();
size_t addModule(Module module);
void removeModule(size_t id);
2021-03-24 20:31:44 +03:00
2021-04-12 01:51:12 +03:00
void damage();
2021-03-22 19:37:34 +03:00
};
2021-04-11 12:45:39 +03:00
}