Пример #1
0
        //private Weather weatherReport = null;

        /// <summary>
        ///
        /// </summary>
        /// <param name="gameAnnouncer"></param>
        /// <param name="cc"></param>
        /// <param name="direction"></param>
        /// <param name="kickingTeam"></param>
        /// <param name="receivingTeam"></param>
        public Kickoff(GameAnnouncer gameAnnouncer, ChainCrew cc, Direction direction, Team kickingTeam, Team receivingTeam)
            : base(cc, receivingTeam, kickingTeam)
        {
            this.cc            = cc;
            this.gameAnnouncer = gameAnnouncer;
            this.kicker        = kickingTeam.TeamOffense.GetPlayerAtPosition("K");
            this.kickReturner  = receivingTeam.TeamOffense.GetPlayerAtPosition("KR");
            this.cc.SetBall(30, direction, this.defense, this.offense);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="callingTeam"></param>
        /// <param name="nonCallingTeam"></param>
        /// <param name="call"></param>
        /// <returns></returns>
        public CoinFlipWinner DeterminePossession(GameAnnouncer announcer, Team callingTeam, Team nonCallingTeam, CoinFlipResult call)
        {
            CoinFlipWinner winner = new CoinFlipWinner()
            {
                Winner = callingTeam, Loser = nonCallingTeam
            };

            if (Flip() != call)
            {
                winner.Winner = nonCallingTeam;
                winner.Loser  = callingTeam;
            }
            announcer.ReportGameEvent(String.Format("{0}: '{1} have won the coin flip.'", announcer.Name, winner.Winner));
            return(winner);
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="id">int</param>
 /// <param name="field">Field</param>
 /// <param name="home">Team</param>
 /// <param name="road">Team</param>
 /// <param name="announcerName">string</param>
 public Game(int id, string fieldName, int fieldCapacity, Team road, Team home, string announcerName, TimeSpan gameTime, Weather weatherReport)
     : base(String.Format("Game {0}", id))
 {
     this.gameStats = new GameStats();
     //this.gameTimer = new System.Timers.Timer(TIMER_SLEEP);
     //this.gameTimer.Elapsed += new ElapsedEventHandler(gameTimer_Elapsed);
     this.weatherReport        = weatherReport;
     this.gameTime             = gameTime;
     this.home                 = home;
     this.road                 = road;
     this.scoreboard           = new Scoreboard(road, home);
     this.scoreboard.gameOver += new GameOverEventHandler(scoreboard_gameOver);
     this.field                = new Field(fieldName, fieldCapacity, this.scoreboard);
     this.cc        = new ChainCrew(this.field, this);
     this.announcer = new GameAnnouncer(cc, announcerName);
     this.announcer.reportAnnounced += new AnnounceReport(announcer_reportAnnounced);
     this.announcer.ReportGameOpening(this, this.field);
     InitGameStats(this.home);
     InitGameStats(this.road);
 }