Пример #1
0
 public void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamArray16(s, ref Items);
     s.Stream(ref ProtoPowerID);
     s.Stream(ref TimesUsed); s.Stream(ref IconLocation);
     s.Stream(ref IgnoreCost); s.Stream(ref IgnoreTechPrereqs); s.Stream(ref IgnorePop);
 }
Пример #2
0
        public virtual void Serialize(IO.EndianStream s)
        {
            s.StreamV(ref Position); s.StreamV(ref Up); s.StreamV(ref Forward); s.StreamV(ref Velocity);
            BActionManager.StreamActionList(s, ref Actions);

            bool has_refs = s.IsReading ? false : HasRefs;

            s.Stream(ref has_refs);
            if (has_refs)
            {
                BSaveGame.StreamArray16(s, ref EntityRefs, cMaximumEntityRefs);
            }

            s.Stream(ref ID);
            s.Stream(ref PlayerID);
            s.Stream(ref YDisplacement);
            s.Stream(ref ObstructionRadiusX); s.Stream(ref ObstructionRadiusY); s.Stream(ref ObstructionRadiusZ);

            #region Flags
            s.Stream(ref FlagCollidable);           s.Stream(ref FlagMoving);                       s.Stream(ref FlagDestroy);
            s.Stream(ref FlagFirstUpdate);          s.Stream(ref FlagTiesToGround);         s.Stream(ref FlagUseMaxHeight);
            s.Stream(ref FlagPhysicsControl);       s.Stream(ref FlagRotateObstruction); s.Stream(ref FlagFlying);
            s.Stream(ref FlagValid);                        s.Stream(ref FlagNonMobile);            s.Stream(ref FlagLockedDown);
            s.Stream(ref FlagEntityRefsLocked);     s.Stream(ref FlagFlyingHeightFixup); s.Stream(ref FlagGarrisoned);
            s.Stream(ref FlagPassiveGarrisoned); s.Stream(ref FlagMoved);                    s.Stream(ref FlagTeleported);
            s.Stream(ref FlagInSniper);                     s.Stream(ref FlagIsBuilt);                      s.Stream(ref FlagHasSounds);
            s.Stream(ref FlagHitched);                      s.Stream(ref FlagSprinting);            s.Stream(ref FlagRecovering);
            s.Stream(ref FlagInCover);                      s.Stream(ref FlagSelectable);           s.Stream(ref FlagUngarrisonValid);
            s.Stream(ref FlagGarrisonValid);        s.Stream(ref FlagIsPhysicsReplacement); s.Stream(ref FlagIsDoneBuilding);
            #endregion

            s.StreamSignature(cSaveMarker.Entity1);
        }
Пример #3
0
        public override void Serialize(IO.EndianStream s)
        {
            base.Serialize(s);

            s.Stream(Total);
            BSaveGame.StreamArray16(s, ref Events);
        }
Пример #4
0
 public void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamArray16(s, ref UniqueNodes);
     s.Stream(ref ResearchPoints);
     s.Stream(ref ResearchBuilding);
     s.Stream(ref Status, BProtoTechStatusStreamer.Instance);
     s.Stream(ref Unique);
 }
Пример #5
0
 public void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamList(s, Concepts, kConceptsListInfo);
     s.Stream(ref TimeSinceLastHint);
     s.Stream(ref HintMessageOn);
     BSaveGame.StreamArray16(s, ref AllowedConcepts);
     Contract.Assert(AllowedConcepts.Length <= BConcept.kMaxCount);
     s.Stream(ref WaitForNextRescore);
     s.Stream(ref LastGameTime);
     s.StreamSignature(cSaveMarker.HintEngine);
 }
Пример #6
0
 public void Serialize(IO.EndianStream s)
 {
     s.StreamV(ref Vector);
     BSaveGame.StreamArray16(s, ref SquadList);
     Contract.Assert(SquadList.Length <= kMaxEntitiesPerList);
     BSaveGame.StreamArray16(s, ref UnitList);
     Contract.Assert(SquadList.Length <= kMaxEntitiesPerList);
     s.Stream(EntityFilterSet);
     s.Stream(ref Float);
     s.Stream(ref ObjectType);
     s.Stream(ref LocStringID);
     s.Stream(ref HasVector); s.Stream(ref HasSquadList); s.Stream(ref HasUnitList);
     s.Stream(ref HasEntityFilterSet); s.Stream(ref HasFloat); s.Stream(ref HasObjectType);
     s.Stream(ref HasLocStringID);
 }
Пример #7
0
        public void Serialize(IO.EndianStream s)
        {
            s.Stream(ref UserMode); s.Stream(ref SubMode);
            if (UserMode == 16)
            {
                SerializeUserMode16(s);
            }

            BSaveGame.StreamArray16(s, ref SelectionList);
            s.Stream(ref CameraZoomMin); s.Stream(ref CameraZoomMax);
            s.Stream(ref CameraPitchMin); s.Stream(ref CameraPitchMax);
            s.Stream(ref CameraPitch); s.Stream(ref CameraYaw);
            s.Stream(ref CameraZoom); s.Stream(ref CameraFOV);
            s.StreamV(ref HoverPoint); s.StreamV(ref CameraHoverPoint);
            s.Stream(ref CameraHoverPointOffsetHeight);
            s.StreamV(ref LastCameraLoc); s.StreamV(ref LastCameraHoverPoint);
            s.Stream(ref HaveHoverPoint); s.Stream(ref HoverPointOverTerrain);
            s.Stream(ref HUDItemEnabled);
            BSaveGame.StreamCollection(s, ObjectiveArrows);
        }
Пример #8
0
        public void Serialize(IO.EndianStream s)
        {
            var sg = s.Owner as BSaveGame;

            BSaveGame.StreamArray16(s, ref Recorders, isIterated: true);
            s.StreamSignature(cSaveMarker.StatsRecorders);
            BSaveGame.StreamCollection(s, Powers);
            s.StreamSignature(cSaveMarker.StatsPowers);
            BSaveGame.StreamCollection(s, Abilities);
            s.StreamSignature(cSaveMarker.StatsAbilities);
            sg.StreamBCost(s, ref TotalResources); sg.StreamBCost(s, ref MaxResources);
            sg.StreamBCost(s, ref GatheredResources); sg.StreamBCost(s, ref TributedResources);
            s.Stream(ref PlayerID);
            s.Stream(ref TeamID);
            s.Stream(ref PlayerStateTime);
            s.Stream(ref PlayerState);
            s.Stream(ref StrengthTime); s.Stream(ref StrengthTimer);
            s.Stream(ref CivID); s.Stream(ref LeaderID);
            s.Stream(ref ResourcesUsed); s.Stream(ref PlayerType);
            s.Stream(ref RandomCiv); s.Stream(ref RandomLeader); s.Stream(ref Resigned);
            s.Stream(ref Defeated); s.Stream(ref Disconnected); s.Stream(ref Won);
            s.StreamSignature(cSaveMarker.StatsPlayer);
        }
Пример #9
0
        public void Serialize(IO.EndianStream s)
        {
            var sg = s.Owner as BSaveGame;

            if (s.IsReading)
            {
                Players = new BPlayer[sg.Players.Count];
                for (int x = 0; x < Players.Length; x++)
                {
                    Players[x] = new BPlayer();
                }
            }

            BSaveGame.StreamArray16(s, ref NumExplorationGroups, isIterated: true);
            BSaveGame.StreamArray(s, ref ActiveExplorationGroups);
            s.StreamSignature(cSaveMarker.World1);
            foreach (var player in Players)
            {
                s.Stream(player);
            }
            s.StreamSignature(cSaveMarker.Players);
            s.StreamSignature(cMaximumSupportedPlayers);
            s.StreamSignature(cMaxPlayerColorCategories);
            for (int x = 0; x < cMaxPlayerColorCategories; x++)
            {
                for (int y = 0; y < cMaximumSupportedPlayers; y++)
                {
                    s.Stream(ref PlayerColorCategories[x, y]);
                }
            }
            s.StreamSignature(cSaveMarker.World2);
            BSaveGame.StreamFreeList(s, SimOrders, BSimOrder.kFreeListInfo);
            BSaveGame.StreamFreeList(s, UnitOpps, BUnitOpp.kFreeListInfo);
            BSaveGame.StreamFreeList(s, PathMoveData, BPathMoveData.kFreeListInfo);

            //...
        }
Пример #10
0
 public void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamArray16(s, ref Filters, maxCount: kMaxCount);
 }
Пример #11
0
 public void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamArray16(s, ref Levels);
     s.Stream(ref XP);
 }
Пример #12
0
 public void Serialize(IO.EndianStream s)
 {
     s.Stream(ref Index);
     BSaveGame.StreamArray16(s, ref Killers);
 }
Пример #13
0
        public void Serialize(IO.EndianStream s)
        {
            var sg = s.Owner as BSaveGame;

            #region Init
            if (s.IsReading)
            {
                ProtoObjects = new List <CondensedListItem16 <BProtoObject> >(sg.Database.GenericProtoObjects.Count);
                ProtoSquads  = new List <CondensedListItem16 <BProtoSquad> >(sg.Database.ProtoSquads.Count);
                ProtoTechs   = new List <CondensedListItem16 <BProtoTech> >(sg.Database.ProtoTechs.Count);

                Powers      = new PowerInfo[sg.Database.ProtoPowers.Count];
                Rates       = new RateInfo[sg.Database.Rates.Count];
                Populations = new BPlayerPop[sg.Database.Populations.Count];

                GenericObjectCounts = new List <CondensedListItemValue16 <UnitCountInfo> >(sg.Database.GenericProtoObjects.Count);
                SquadCounts         = new List <CondensedListItemValue16 <UnitCountInfo> >(sg.Database.ProtoSquads.Count);
                WeaponTypes         = new List <CondensedListItemValue8 <WeaponType> >(sg.Database.WeaponTypes.Count);
            }
            #endregion

            #region Player1
            s.StreamV(ref LookAtPos);
            s.StreamPascalString32(ref Name);
            s.StreamV(ref RallyPoint);
            s.Stream(StatsManager);
            BSaveGame.StreamList(s, ProtoObjects, kProtoUnitsListInfo);
            BSaveGame.StreamList(s, ProtoSquads, kProtoUnitsListInfo);
            BSaveGame.StreamList(s, ProtoTechs, kProtoTechsListInfo);
            BSaveGame.StreamArray16(s, ref UniqueProtoObjects);
            Contract.Assert(UniqueProtoObjects.Length <= kProtoUniqueUnitsListInfo.MaxCount);
            BSaveGame.StreamArray16(s, ref UniqueProtoSquad);
            Contract.Assert(UniqueProtoSquad.Length <= kProtoUniqueUnitsListInfo.MaxCount);
            BSaveGame.StreamArray(s, ref PowerEntries);
            BSaveGame.StreamArray(s, ref Abilities);
            for (int x = 0; x < Powers.Length; x++)
            {
                s.Stream(ref Powers[x]);
            }
            sg.StreamBCost(s, ref Resources);
            for (int x = 0; x < Rates.Length; x++)
            {
                s.Stream(ref Rates[x]);
            }
            sg.StreamBCost(s, ref TotalResources);
            sg.StreamBCost(s, ref ResourceTrickleRate);
            for (int x = 0; x < Populations.Length; x++)
            {
                s.Stream(ref Populations[x]);
            }
            s.StreamSignature(cSaveMarker.Player1);
            #endregion
            #region Player2
            s.StreamNotNull(ref HintEngine);
            BSaveGame.StreamList(s, GenericObjectCounts, kUnitCountsListInfo);
            BSaveGame.StreamList(s, SquadCounts, kUnitCountsListInfo);
            s.StreamSignature(cSaveMarker.Player2);
            #endregion
            #region Player3
            s.Stream(ref TotalFutureUnitCounts); s.Stream(ref TotalDeadUnitCounts);
            s.Stream(ref TotalFutureSquadCounts); s.Stream(ref TotalDeadSquadCounts);
            BSaveGame.StreamArray(s, ref GotoBases);
            BSaveGame.StreamList(s, WeaponTypes, kWeaponTypesListInfo);
            BSaveGame.StreamArray16(s, ref AbilityRecoverTimes);
            s.Stream(TechTree);
            s.StreamSignature(cSaveMarker.Player3);
            #endregion
            #region Player4
            s.Stream(ref MPID); s.Stream(ref ColorIndex);
            s.Stream(ref ID); s.Stream(ref CoopID); s.Stream(ref ScenarioID);
            s.Stream(ref CivID);
            s.Stream(ref TeamID);
            s.Stream(ref PlayerState);
            s.Stream(ref LeaderID); s.Stream(ref BountyResource);
            s.Stream(ref RallyObject);
            s.Stream(ref Strength);
            s.Stream(ref TributeCost);
            sg.StreamBCost(s, ref RepairCost);
            s.Stream(ref RepairTime); s.Stream(ref HandicapMultiplier); s.Stream(ref ShieldRegenRate);
            s.Stream(ref ShieldRegenDelay);
            s.Stream(ref TotalCombatValue);
            s.Stream(ref Difficulty);
            s.Stream(ref GamePlayedTime);
            s.Stream(ref FloodPoofPlayer);
            s.Stream(ref PlayerType); s.Stream(ref SquadSearchAttempts);
            s.Stream(ref WeaponPhysicsMultiplier); s.Stream(ref AIDamageMultiplier); s.Stream(ref AIDamageTakenMultiplier);
            s.Stream(ref AIBuildSpeedMultiplier);
            s.Stream(ref FlagRallyPoint); s.Stream(ref FlagBountyResource); s.Stream(ref FlagMinimapBlocked);
            s.Stream(ref FlagLeaderPowersBlocked); s.Stream(ref FlagDefeatedDestroy);
            s.Stream(ref SquadAISearchIndex); s.Stream(ref SquadAIWorkIndex); s.Stream(ref SquadAISecondaryTurretScanIndex);
            s.StreamSignature(cSaveMarker.Player4);
            #endregion
            s.TraceAndDebugPosition(ref mPositionMarker);
        }
Пример #14
0
 public virtual void Serialize(IO.EndianStream s)
 {
     BSaveGame.StreamArray16(s, ref Killers, isIterated: true);
     BSaveGame.StreamArray16(s, ref Combat);
     s.StreamSignature(BStatCombat.DoneIndex);
 }
Пример #15
0
        public override void Serialize(IO.EndianStream s)
        {
            BSaveGame.StreamArray16(s, ref ObjectTypes);

            base.Serialize(s);
        }
Пример #16
0
        public override void Serialize(IO.EndianStream s)
        {
            BSaveGame.StreamArray16(s, ref ProtoSquads);

            base.Serialize(s);
        }
Пример #17
0
            public uint[] Values;             // Type

            #region IEndianStreamSerializable Members
            public void Serialize(IO.EndianStream s)
            {
                BSaveGame.StreamArray16(s, ref Keys);
                BSaveGame.StreamArray16(s, ref Values);
            }