6352e8e319
all at once
19 lines
514 B
C++
19 lines
514 B
C++
#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())}};
|
|
}
|
|
|
|
}
|