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
                );
        }
示例#2
0
 public Domination(Team[] teams, int scoreintervall, int scorelimit, float timelimit)
 {
     ScoreIntervall = scoreintervall;
     TeamScoreLimit = scorelimit;
     Teams = teams;
     TimeLimit = timelimit;
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 public TeamDeathMatch(Team[] teams, int teamscorelimit, float timelimit)
     : base(0, timelimit)
 {
     Teams = teams;
     TeamScoreLimit = teamscorelimit;
 }
示例#6
0
 public CaptureTheFlag(Team[] teams, int capturelimit, float timelimit)
     : base(teams, 0, timelimit)
 {
     CaptureLimit = capturelimit;
 }
示例#7
0
        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"));
        }