public virtual void Save(ZoneSaveData saveData) { if (IsEnabled) { PersistNpcData(); } _variables.SaveTo(saveData.PersistentVariables, VariableDefinition.Saved); saveData.Npcs = _npcData.Select(npc => npc.Value).ToList(); }
protected virtual void Save(CreatureSaveData data) { data.Name = Name; data.LearnedSkills = _learnedSkills; Traits.SaveTo(data.Traits, VariableDefinition.Saved); foreach (var move in Moves) { data.Moves.Add(Move.Save(move)); } }
public virtual void Save(NpcSaveData saveData) { _variables.SaveTo(saveData.NpcTraits, VariableDefinition.Saved); if (Controller) { saveData.Position = Controller.Mover.CurrentGridPosition; saveData.Direction = Controller.Mover.MovementDirection; saveData.ControllerData = Controller.Save(); } if (Trainer) { Trainer.Traits.SaveTo(saveData.TrainerTraits, VariableDefinition.Saved); } }
public virtual string Save(WorldSaveData saveData) { _variables.SaveTo(saveData.PersistentVariables, VariableDefinition.Saved); foreach (var zone in Zones) { if (zone != null) { var zoneSaveData = new ZoneSaveData(); zone.Save(zoneSaveData); zoneSaveData.Name = zone.Zone.name; saveData.Zones.Add(zoneSaveData); } } return(SaveFilename); }
public virtual void Save(PlayerSaveData saveData) { _variables.SaveTo(saveData.PlayerTraits, VariableDefinition.Saved); saveData.Name = Name; Trainer.Traits.SaveTo(saveData.TrainerTraits, VariableDefinition.Saved); foreach (var creature in Trainer.Roster) { saveData.Creatures.Add(Creature.Save(creature.Creature)); } foreach (var item in Trainer.Inventory.Items) { saveData.Items.Add(new ItemSaveData { ItemPath = item.Item.Path, Count = item.Count }); } }
protected virtual void Save(MoveSaveData data) { data.Name = Name; Traits.SaveTo(data.Traits, VariableDefinition.Saved); }