Exemplo n.º 1
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);

            //...
        }