mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Implemented serialization of local player state in json form
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "queries/MapQueries.h"
|
||||
|
||||
#include "../lib/IGameCallback.h"
|
||||
#include "../lib/CPlayerState.h"
|
||||
#include "../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../lib/gameState/CGameState.h"
|
||||
@@ -389,6 +390,13 @@ void ApplyGhNetPackVisitor::visitQueryReply(QueryReply & pack)
|
||||
result = gh.queryReply(pack.qid, pack.reply, pack.player);
|
||||
}
|
||||
|
||||
void ApplyGhNetPackVisitor::visitSaveLocalState(SaveLocalState & pack)
|
||||
{
|
||||
gh.throwIfWrongPlayer(&pack);
|
||||
*gh.gameState()->getPlayerState(pack.player)->playerLocalSettings = pack.data;
|
||||
result = true;
|
||||
}
|
||||
|
||||
void ApplyGhNetPackVisitor::visitMakeAction(MakeAction & pack)
|
||||
{
|
||||
gh.throwIfWrongPlayer(&pack);
|
||||
|
||||
Reference in New Issue
Block a user