osb/source/game/StarAiTypes.cpp

19 lines
514 B
C++
Raw Normal View History

2023-06-20 04:33:09 +00:00
#include "StarAiTypes.hpp"
#include "StarJsonExtra.hpp"
namespace Star {
AiState::AiState() {}
AiState::AiState(Json const& v) {
availableMissions.addAll(jsonToStringList(v.get("availableMissions", JsonArray())));
completedMissions.addAll(jsonToStringList(v.get("completedMissions", JsonArray())));
}
Json AiState::toJson() const {
return JsonObject{{"availableMissions", jsonFromStringList(availableMissions.values())},
{"completedMissions", jsonFromStringList(completedMissions.values())}};
}
}