コード例 #1
0
        public virtual void Save(ZoneSaveData saveData)
        {
            if (IsEnabled)
            {
                PersistNpcData();
            }

            _variables.SaveTo(saveData.PersistentVariables, VariableDefinition.Saved);
            saveData.Npcs = _npcData.Select(npc => npc.Value).ToList();
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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
                });
            }
        }
コード例 #6
0
 protected virtual void Save(MoveSaveData data)
 {
     data.Name = Name;
     Traits.SaveTo(data.Traits, VariableDefinition.Saved);
 }