Hook() public method

public Hook ( RTSRenderer renderer, GameState s, int ti, int fti, int building ) : void
renderer RTSRenderer
s RTSEngine.Data.GameState
ti int
fti int
building int
return void
Esempio n. 1
0
        private void LoadTeamVisuals(GameState state, int ti)
        {
            RTSTeam team = state.teams[ti];

            // Create Unit Graphics
            var ums = ti == teamIndex ? FriendlyUnitModels : NonFriendlyUnitModels;

            for (int i = 0; i < team.Race.ActiveUnits.Length; i++)
            {
                int          ui     = team.Race.ActiveUnits[i].Index;
                RTSUnitData  uData  = team.Race.Units[ui];
                RTSUnitModel uModel = RTSUnitDataParser.ParseModel(this, new FileInfo(uData.InfoFile), team.Race);
                uModel.Hook(this, state, ti, team.Race.ActiveUnits[i].Index);
                uModel.ColorScheme = team.ColorScheme;
                ums.Add(uModel);
            }

            // Create Building Graphics
            var bms = ti == teamIndex ? FriendlyBuildingModels : NonFriendlyBuildingModels;

            for (int i = 0; i < team.Race.ActiveBuildings.Length; i++)
            {
                RTSBuildingModel bModel = RTSBuildingDataParser.ParseModel(this, new FileInfo(team.Race.ActiveBuildings[i].InfoFile), team.Race);
                bModel.Hook(this, state, ti, teamIndex, team.Race.ActiveBuildings[i].Index);
                bModel.ColorScheme = team.ColorScheme;
                bms.Add(bModel);
            }
        }