コード例 #1
0
ファイル: WeakEntityCollection.cs プロジェクト: favesc/ServUO
        public static void Save()
        {
            Persistence.Serialize(
                _FilePath,
                writer =>
            {
                writer.Write(1);                         // Version

                writer.Write(_Collections.Count);

                foreach (var kv in _Collections)
                {
                    writer.Write(kv.Key);

                    kv.Value.RemoveAll(ent => ent == null || ent.Deleted);

                    writer.Write(kv.Value.Count);

                    foreach (var ent in kv.Value)
                    {
                        writer.Write(ent.Serial);
                    }
                }
            });
        }
コード例 #2
0
        public static void OnSave(WorldSaveEventArgs e)
        {
            Persistence.Serialize(
                FilePath,
                writer =>
            {
                writer.Write((int)0);

                writer.Write(LastReset);

                writer.Write(ROTTable.Count);
                foreach (KeyValuePair <PlayerMobile, Dictionary <SkillName, DateTime> > kvp in ROTTable)
                {
                    writer.Write(kvp.Key);
                    writer.Write(kvp.Value.Count);

                    foreach (KeyValuePair <SkillName, DateTime> kvp2 in kvp.Value)
                    {
                        writer.Write((int)kvp2.Key);
                        writer.Write(kvp2.Value);
                    }
                }

                writer.Write(StatsTable.Count);
                foreach (KeyValuePair <PlayerMobile, int> kvp in StatsTable)
                {
                    writer.Write(kvp.Key);
                    writer.Write(kvp.Value);
                }
            });
        }
コード例 #3
0
 public static void OnSave(WorldSaveEventArgs e)
 {
     Persistence.Serialize(
         FilePath,
         writer =>
     {
         writer.Write((int)2);
     });
 }
コード例 #4
0
 public static void OnSave(WorldSaveEventArgs e)
 {
     Persistence.Serialize(
         FilePath,
         writer =>
     {
         writer.Write((int)8);
         writer.Write(false);
         writer.Write(_SpawnsConverted);
     });
 }
コード例 #5
0
 public static void OnSave(WorldSaveEventArgs e)
 {
     Persistence.Serialize(FilePath, OnSerialize);
 }