public GameRule CreateRule() { string[] teamnames = Array.FindAll<string>(Teams.Lines, delegate(string s1) { return s1.Length > 0; }); if (teamnames.Length < 2) throw new Exception(); Team[] teams=new Team[teamnames.Length]; for(int i=0;i<teams.Length;++i) { teams[i]=new Team(i,teamnames[i]); } return new TeamDeathMatch( teams, (int)FragLimit.Value, (float)TimeLimit.Value * 60 ); }
public Domination(Team[] teams, int scoreintervall, int scorelimit, float timelimit) { ScoreIntervall = scoreintervall; TeamScoreLimit = scorelimit; Teams = teams; TimeLimit = timelimit; }
public override GameRule New() { Team[] newteams = new Team[Teams.Length]; for (int i = 0; i < newteams.Length; ++i) { newteams[i] = CreateTeam(); newteams[i].Index = Teams[i].Index; newteams[i].Name = Teams[i].Name; } return new CaptureTheFlag(newteams, CaptureLimit, TimeLimit); }
public override GameRule New() { Team[] newteams = new Team[Teams.Length]; for (int i = 0; i < newteams.Length; ++i) newteams[i] = new Team(Teams[i].Index, Teams[i].Name); return new TeamDeathMatch(newteams,TeamScoreLimit,TimeLimit); }
public TeamDeathMatch(Team[] teams, int teamscorelimit, float timelimit) : base(0, timelimit) { Teams = teams; TeamScoreLimit = teamscorelimit; }
public CaptureTheFlag(Team[] teams, int capturelimit, float timelimit) : base(teams, 0, timelimit) { CaptureLimit = capturelimit; }
protected GameRule CreateTeamDeathMatch() { Config c = Root.Instance.ResourceManager.LoadConfig("config/global.config"); int numteams = c.GetInteger("teamdeathmatch.teams"); Team[] teams = new Team[numteams]; for (int i = 0; i < teams.Length; ++i) { teams[i] = new Team(i, c.GetString("teamdeathmatch.team" + i + ".name")); } return new TeamDeathMatch(teams, c.GetInteger("teamdeathmatch.teamscorelimit"), c.GetFloat("teamdeathmatch.timelimit")); }