1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00
openmw-tes3mp/apps/openmw-mp/Cell.hpp

65 lines
1.1 KiB
C++
Raw Normal View History

2017-02-19 05:26:42 +00:00
//
// Created by koncord on 18.02.17.
//
#ifndef OPENMW_CELL_HPP
#define OPENMW_CELL_HPP
#include <deque>
#include <string>
#include <components/esm/records.hpp>
class Player;
class Cell;
class CellController
{
private:
CellController();
~CellController();
CellController(CellController&); // not used
public:
2017-02-19 08:07:44 +00:00
static void create();
static void destroy();
static CellController *get();
2017-02-19 05:26:42 +00:00
public:
typedef std::deque<Cell*> TContainer;
typedef TContainer::iterator TIter;
2017-02-19 08:07:44 +00:00
Cell * addCell(ESM::Cell cell);
void removeCell(Cell *);
2017-02-19 05:26:42 +00:00
2017-02-19 08:07:44 +00:00
void removePlayer(Cell *cell, Player *player);
2017-02-19 05:26:42 +00:00
2017-02-19 08:07:44 +00:00
Cell *getCellByXY(int x, int y);
Cell *getCellByID(std::string cellid);
2017-02-19 05:26:42 +00:00
void update(Player *player);
private:
static CellController *sThis;
TContainer cells;
};
class Cell
{
friend class CellController;
public:
Cell(ESM::Cell cell);
typedef std::deque<Player*> TPlayers;
typedef TPlayers::iterator Iterator;
2017-02-19 08:07:44 +00:00
void addPlayer(Player *player);
void removePlayer(Player *player);
2017-02-19 05:26:42 +00:00
TPlayers getPlayers();
private:
TPlayers players;
ESM::Cell cell;
};
#endif //OPENMW_CELL_HPP