2017-04-05 09:00:21 +00:00
|
|
|
#ifndef OPENMW_CELLCONTROLLER_HPP
|
|
|
|
#define OPENMW_CELLCONTROLLER_HPP
|
2016-11-15 16:42:52 +00:00
|
|
|
|
2017-04-06 01:00:50 +00:00
|
|
|
#include "Cell.hpp"
|
2017-04-09 13:32:44 +00:00
|
|
|
#include "ActorList.hpp"
|
2017-04-05 21:49:20 +00:00
|
|
|
#include "LocalActor.hpp"
|
|
|
|
#include "DedicatedActor.hpp"
|
2016-12-16 09:27:19 +00:00
|
|
|
#include "../mwworld/cellstore.hpp"
|
|
|
|
|
2016-11-15 16:42:52 +00:00
|
|
|
namespace mwmp
|
|
|
|
{
|
2017-04-05 09:00:21 +00:00
|
|
|
class CellController
|
2016-11-15 16:42:52 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2017-04-05 09:00:21 +00:00
|
|
|
CellController();
|
2017-07-03 15:41:16 +00:00
|
|
|
virtual ~CellController();
|
2016-11-15 17:13:36 +00:00
|
|
|
|
2017-04-10 14:10:18 +00:00
|
|
|
void updateLocal(bool forceUpdate);
|
2017-04-07 12:51:34 +00:00
|
|
|
void updateDedicated(float dt);
|
|
|
|
|
2017-04-08 09:33:41 +00:00
|
|
|
void initializeCell(const ESM::Cell& cell);
|
2020-08-11 02:15:12 +00:00
|
|
|
void uninitializeCell(const ESM::Cell& cell);
|
2020-08-16 21:56:01 +00:00
|
|
|
void uninitializeCells();
|
2017-04-13 12:26:48 +00:00
|
|
|
|
2017-04-10 14:10:18 +00:00
|
|
|
void readPositions(mwmp::ActorList& actorList);
|
2017-04-15 07:47:53 +00:00
|
|
|
void readAnimFlags(mwmp::ActorList& actorList);
|
2017-04-15 10:42:30 +00:00
|
|
|
void readAnimPlay(mwmp::ActorList& actorList);
|
2017-04-16 13:42:07 +00:00
|
|
|
void readStatsDynamic(mwmp::ActorList& actorList);
|
2019-12-05 11:27:55 +00:00
|
|
|
void readDeath(mwmp::ActorList& actorList);
|
2017-05-26 01:37:49 +00:00
|
|
|
void readEquipment(mwmp::ActorList& actorList);
|
2017-04-16 15:43:13 +00:00
|
|
|
void readSpeech(mwmp::ActorList& actorList);
|
2021-04-20 01:25:14 +00:00
|
|
|
void readSpellsActive(mwmp::ActorList& actorList);
|
2018-07-12 17:48:47 +00:00
|
|
|
void readAi(mwmp::ActorList& actorList);
|
2017-04-19 19:10:06 +00:00
|
|
|
void readAttack(mwmp::ActorList& actorList);
|
2019-08-25 06:35:23 +00:00
|
|
|
void readCast(mwmp::ActorList& actorList);
|
2017-04-23 10:59:15 +00:00
|
|
|
void readCellChange(mwmp::ActorList& actorList);
|
2017-04-05 21:49:20 +00:00
|
|
|
|
2019-12-05 11:27:55 +00:00
|
|
|
bool hasQueuedDeathState(MWWorld::Ptr ptr);
|
|
|
|
unsigned int getQueuedDeathState(MWWorld::Ptr ptr);
|
|
|
|
void clearQueuedDeathState(MWWorld::Ptr ptr);
|
|
|
|
void setQueuedDeathState(MWWorld::Ptr ptr, unsigned int deathState);
|
|
|
|
|
2017-04-07 05:12:50 +00:00
|
|
|
void setLocalActorRecord(std::string actorIndex, std::string cellIndex);
|
|
|
|
void removeLocalActorRecord(std::string actorIndex);
|
2017-04-19 15:20:12 +00:00
|
|
|
|
2017-04-08 11:31:22 +00:00
|
|
|
bool isLocalActor(MWWorld::Ptr ptr);
|
2018-07-13 01:12:03 +00:00
|
|
|
bool isLocalActor(int refNum, int mpNum);
|
2017-04-07 07:16:23 +00:00
|
|
|
virtual LocalActor *getLocalActor(MWWorld::Ptr ptr);
|
2018-07-13 01:12:03 +00:00
|
|
|
virtual LocalActor *getLocalActor(int refNum, int mpNum);
|
2017-04-07 07:16:23 +00:00
|
|
|
|
2017-04-08 04:46:33 +00:00
|
|
|
void setDedicatedActorRecord(std::string actorIndex, std::string cellIndex);
|
|
|
|
void removeDedicatedActorRecord(std::string actorIndex);
|
2017-04-19 15:20:12 +00:00
|
|
|
|
2017-04-08 11:31:22 +00:00
|
|
|
bool isDedicatedActor(MWWorld::Ptr ptr);
|
2018-07-13 01:12:03 +00:00
|
|
|
bool isDedicatedActor(int refNum, int mpNum);
|
2017-04-08 04:46:33 +00:00
|
|
|
virtual DedicatedActor *getDedicatedActor(MWWorld::Ptr ptr);
|
2018-07-13 01:12:03 +00:00
|
|
|
virtual DedicatedActor *getDedicatedActor(int refNum, int mpNum);
|
2017-04-08 04:46:33 +00:00
|
|
|
|
2017-05-27 13:58:59 +00:00
|
|
|
std::string generateMapIndex(int refNumindex, int mpNum);
|
2017-04-07 05:12:50 +00:00
|
|
|
std::string generateMapIndex(MWWorld::Ptr ptr);
|
2017-04-09 13:32:44 +00:00
|
|
|
std::string generateMapIndex(mwmp::BaseActor baseActor);
|
2017-04-07 05:12:50 +00:00
|
|
|
|
2017-05-04 23:46:16 +00:00
|
|
|
bool hasLocalAuthority(const ESM::Cell& cell);
|
2018-01-07 00:35:30 +00:00
|
|
|
bool isInitializedCell(const std::string& cellDescription);
|
2017-04-23 13:53:24 +00:00
|
|
|
bool isInitializedCell(const ESM::Cell& cell);
|
2017-04-23 14:12:45 +00:00
|
|
|
bool isActiveWorldCell(const ESM::Cell& cell);
|
2017-04-10 15:13:22 +00:00
|
|
|
virtual Cell *getCell(const ESM::Cell& cell);
|
|
|
|
|
2017-04-10 14:30:57 +00:00
|
|
|
virtual MWWorld::CellStore *getCellStore(const ESM::Cell& cell);
|
2017-02-26 23:02:59 +00:00
|
|
|
|
2017-04-23 09:41:13 +00:00
|
|
|
bool isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCell);
|
|
|
|
|
2017-04-10 15:13:22 +00:00
|
|
|
int getCellSize() const;
|
|
|
|
|
2017-04-05 21:49:20 +00:00
|
|
|
private:
|
2017-04-23 13:53:24 +00:00
|
|
|
static std::map<std::string, mwmp::Cell *> cellsInitialized;
|
2017-04-07 05:12:50 +00:00
|
|
|
static std::map<std::string, std::string> localActorsToCells;
|
2017-04-08 04:46:33 +00:00
|
|
|
static std::map<std::string, std::string> dedicatedActorsToCells;
|
2019-12-05 11:27:55 +00:00
|
|
|
static std::map<std::string, unsigned int> queuedDeathStates;
|
2016-11-15 16:42:52 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-04-05 09:00:21 +00:00
|
|
|
#endif //OPENMW_CELLCONTROLLER_HPP
|