コード例 #1
0
        public static void Deserialize(BinaryReader s, Dictionary <string, ReflectedScript> res, GameState state)
        {
            state.curFrame   = s.ReadInt32();
            state.timePlayed = s.ReadSingle();
            UUIDGenerator.SetUUID(s.ReadInt32());
            state.Scripts = new Dictionary <string, ReflectedScript>(res);
            int c = s.ReadInt32();

            for (int i = 0; i < c; i++)
            {
                int ti = s.ReadInt32();
                state.teams[ti] = RTSTeam.Deserialize(s, ti, state);
            }
            state.UpdateActiveTeams();
            c = s.ReadInt32();
            for (int i = 0; i < c; i++)
            {
                var ebu = EnemyBuildingUpdater.Deserialize(s, state);
                state.tbMemBuildings.AddTask(ebu);
            }
            LevelGrid.Deserialize(s, state);
        }