1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00
openmw-tes3mp/apps/openmw-mp/Worldstate.hpp
David Cernat 176aa62b15 Merge pull request #446 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Cells.cpp
	apps/openmw-mp/Script/Functions/Cells.hpp
	apps/openmw-mp/Script/Functions/Worldstate.cpp
	apps/openmw-mp/Script/Functions/Worldstate.hpp
	apps/openmw-mp/Script/ScriptFunctions.hpp
	apps/openmw-mp/processors/player/ProcessorPlayerMap.hpp
	apps/openmw/mwmp/processors/player/ProcessorPlayerMap.hpp
	components/openmw-mp/Base/BasePlayer.hpp
	components/openmw-mp/Packets/Player/PacketPlayerMap.hpp
	components/openmw-mp/Packets/Worldstate/PacketWorldMap.cpp
2018-06-07 23:23:19 +03:00

82 lines
1.6 KiB
C++

#pragma once
#include <RakNetTypes.h>
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
#include <components/openmw-mp/Packets/Worldstate/WorldstatePacket.hpp>
#include "BaseMgr.hpp"
class LuaState;
class MapTile
{
friend class MapTiles;
public:
static void Init(LuaState &lua);
public:
explicit MapTile(mwmp::BaseMapTile &mapTile);
int getCellX() const;
void setCellX(int cellX);
int getCellY() const;
void setCellY(int cellY);
void loadImageFile(const char* filePath);
void saveImageFile(const char *filePath);
mwmp::BaseMapTile mapTile;
};
class MapTiles final : public BaseMgr
{
public:
static void Init(LuaState &lua);
public:
explicit MapTiles(Worldstate *worldstate);
void addMapTile(const MapTile &mapTile);
MapTile getMapTile(int id) const;
void setMapTile(int id, const MapTile &mapTile);
size_t size() const;
void clear();
private:
void processUpdate() final;
};
class Worldstate : public mwmp::BaseWorldstate
{
public:
explicit Worldstate();
static void Init(LuaState &lua);
void update();
MapTiles &getMapTiles();
void setHour(double hour);
void setDay(int day);
void setMonth(int month);
void setYear(int year);
void setDaysPassed(int daysPassed);
void setTimeScale(float timeScale);
void setPlayerCollisionState(bool state);
void setActorCollisionState(bool state);
void setPlacedObjectCollisionState(bool state);
void setActorCollisionForPlacedObjects(bool state);
private:
bool shouldUpdateTime, shouldUpdateCollisionOverrides;
MapTiles mapTiles;
};