Beispiel #1
0
        public void Serialize(IO.BitStream s)
        {
            using (s.EnterOwnerBookmark(this))
            {
                s.Stream(ref mEncodingVersion);
                if (s.IsReading && !VerifyEncodingVersion())
                {
                    throw new IO.VersionMismatchException("Megalo encoding", (uint)mEncodingVersion);
                }

                s.Stream(ref EngineVersion);                                            // global, not a c_game_engine_megalo_variant member
                s.StreamObject(BaseVariant);
                s.StreamElements(PlayerTraits,
                                 MegaloDatabase.Limits.PlayerTraits.CountBitLength,
                                 this, _this => _this.NewMegaloPlayerTraits());
                s.StreamElements(UserDefinedOptions,
                                 MegaloDatabase.Limits.UserDefinedOptions.CountBitLength);
                s.StreamObject(StringTable);
                StreamStringTableIndexPointer(s, ref BaseNameStringIndex);
                SerializeDescriptionLocaleStrings(s);
                s.StreamNoneable(ref EngineIconIndex,
                                 MegaloDatabase.Limits.EngineCategories.IndexBitLength);
                s.StreamNoneable(ref EngineCategory,
                                 MegaloDatabase.Limits.EngineCategories.IndexBitLength);
                s.StreamObject(MapPermissions);
                s.StreamObject(PlayerRatingParameters);
                s.Stream(ref ScoreToWinRound);

                SerializeImpl(s);
            }
        }
        public void Serialize(IO.BitStream s)
        {
            if (s.IsWriting)
            {
                BeginCompile();
            }

            using (s.EnterOwnerBookmark(this))
                SerializeImpl(s);

            if (s.IsWriting)
            {
                EndCompile();
            }
            else
            {
                BeginDecompile();
                EndDecompile();
            }
        }
Beispiel #3
0
 public void Serialize(IO.BitStream s)
 {
     using (s.EnterOwnerBookmark(this))
         SerializeImpl(s);
 }