Example #1
0
 public void BuildGameMap(Player player, JsonSavedGame savedGame)
 {
     this.level = savedGame.Level;
     BuildMap(savedGame.Map);
     CentreCamera();
     BuildContent(savedGame.Map);
     BuildPlayerAvatar(player, savedGame.Player);
     BuildNPC(level, savedGame.NPCList);
     BuildAffector(savedGame.Map.DrugAffect);
 }
Example #2
0
 private void StartGame_Loading(JsonSavedGame savedGame)
 {
     var player = SetGameStatesAndGetPlayerInstance(savedGame.Level);
     MapBuilder.I.BuildGameMap(player, savedGame);
 }
Example #3
0
 private void SaveGame()
 {
     JsonSavedGame savedGame = new JsonSavedGame();
     savedGame.Level = level;
     savedGame.Map = (JsonMap)map.GetJsonObject();
     savedGame.Player = (JsonPlayer)player.GetJsonObject();
     savedGame.NPCList = npcList.ConvertAll((npc) => (JsonNPC)npc.GetJsonObject());
     File.WriteAllText(Environment.CurrentDirectory + SAVED_GAME_PATH, JsonConvert.SerializeObject(savedGame, Formatting.Indented));
 }