UpdateActiveTeams() public méthode

public UpdateActiveTeams ( ) : void
Résultat void
        public static void BuildLocal(GameState state, EngineLoadData eld, DirectoryInfo root, Dictionary<string, FileInfo> races)
        {
            // Copy Over All The Scripts
            foreach(KeyValuePair<string, ReflectedScript> kv in Scripts)
                state.Scripts.Add(kv.Key, kv.Value);

            // Load The Map
            BuildMap(state, eld.MapFile);

            BuildTeams(state, eld, races);
            state.UpdateActiveTeams();

            // Hook Building Spawn Events To Collision Grid
            foreach(var team in (from t in state.activeTeams select t.Team)) {
                team.OnBuildingSpawn += state.CGrid.OnBuildingSpawn;
            }
        }
Exemple #2
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);
        }
 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);
 }