예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="offense">Team</param>
 /// <param name="defense">Team</param>
 public Play(ChainCrew cc, Team offense, Team defense)
 {
     this.cc = cc;
     this.cc.playCompleted += new PlayEventHandler(cc_onPlayCompleted);
     this.offense           = offense;
     this.defense           = defense;
 }
예제 #2
0
파일: Fumble.cs 프로젝트: mdbull/Football
 private Player originalBallcarrier = null;//player who fumbled
 /// <summary>
 ///
 /// </summary>
 /// <param name="originalBallcarrier"></param>
 /// <param name="defense"></param>
 public Fumble(ChainCrew cc, Player originalBallcarrier, Team defense)
 {
     this.cc = cc;
     this.originalBallcarrier  = originalBallcarrier;
     this.principalBallcarrier = defense.TeamOffense.GetPlayerAtPosition("TB");
     this.defense = defense;
 }
예제 #3
0
파일: PassPlay.cs 프로젝트: mdbull/Football
        /// <summary>
        ///
        /// </summary>
        /// <param name="cc">ChainCrew</param>
        /// <param name="thrower">Player</param>
        private void OnInterceptionOccurred(ChainCrew cc, Player thrower)
        {
            Interception interception = new Interception(cc, thrower, cc.TeamNotInPossession);
            int          length       = interception.Execute();

            length = cc.MoveBallDefensiveReturn(interception);
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="offense">Team</param>
 /// <param name="defense">Team</param>
 /// <param name="principalBallcarrier">Player</param>
 /// <param name="playLength">int</param>
 public Play(ChainCrew cc, Team offense, Team defense, Player principalBallcarrier, int playLength)
 {
     this.cc = cc;
     this.cc.playCompleted    += new PlayEventHandler(cc_onPlayCompleted);
     this.offense              = offense;
     this.defense              = defense;
     this.principalBallcarrier = principalBallcarrier;
     this.playLength           = playLength;
 }
예제 #5
0
파일: Kickoff.cs 프로젝트: mdbull/Football
        //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);
        }
예제 #6
0
파일: Safety.cs 프로젝트: mdbull/Football
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="offense">Team</param>
 /// <param name="defense">Team</param>
 public Safety(ChainCrew cc, Player ballcarrier, Team defense, int playLength)
     : base(playLength)
 {
     this.cc              = cc;
     this.defense         = defense;
     principalBallcarrier = ballcarrier;
     recoveringDefender   = new Player(defense, "11", "Defender", "RM", 18, 72, 200, Race.Black, Grade.Senior, Endurance.Good, "99", 25);
     recoveringDefender.Positions.Add("DL");
 }
예제 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="name">string</param>
 public GameAnnouncer(ChainCrew cc, string name)
 {
     this.cc = cc;
     this.cc.touchdownScored    += new TouchdownScoredEventHandler(cc_onTouchdownScored);
     this.cc.playCompleted      += new PlayEventHandler(cc_onPlayCompleted);
     this.cc.turnoverCompleted  += new TurnoverEventHandler(cc_onTurnoverCompleted);
     this.cc.fieldGoalAttempted += new FieldGoalAttemptedEventHandler(cc_fieldGoalAttempted);
     this.cc.fumbleOccurred     += new FumbleOccurredEventHandler(cc_fumbleOccurred);
     this.cc.safetyOccurred     += new SafetyEventHandler(cc_safetyOccurred);
     this.name = name;
 }
예제 #8
0
파일: PassPlay.cs 프로젝트: mdbull/Football
        /// <summary>
        ///
        /// </summary>
        /// <param name="cc"></param>
        /// <param name="offense"></param>
        /// <param name="defense"></param>
        /// <param name="gamePassStats"></param>
        /// <param name="gameRunStats"></param>
        /// <param name="gameReceiverStats"></param>
        public PassPlay(GameStats gameStats, ChainCrew cc)
            : base(cc, cc.TeamInPossession, cc.TeamNotInPossession)
        {
            Team tip  = this.offense;
            Team tnip = this.defense;

            this.thrower              = tip.TeamOffense.GetPlayerAtPosition("QB");
            this.availableReceivers   = tip.TeamOffense.AvailableReceivers;
            this.principalBallcarrier = SelectReceiver(tip.TeamOffense.AvailableReceivers[0], tip.TeamOffense.AvailableReceivers);

            int throwerIndex  = tip.GetIndexOfPlayer(this.thrower);
            int receiverIndex = tip.TeamOffense.GetAvailableReceiverAtIndex(this.principalBallcarrier);

            this.gamePassStats     = (PassPlayStatSheet)gameStats[tip, throwerIndex][StatTypes.Pass];
            this.gameRunStats      = (CarryStatSheet)gameStats[tip, throwerIndex][StatTypes.Run];
            this.gameReceiverStats = (CarryStatSheet)gameStats[tip, receiverIndex][StatTypes.Receive];
        }
예제 #9
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);
 }
예제 #10
0
파일: RunPlay.cs 프로젝트: mdbull/Football
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="offense">Team</param>
 /// <param name="defense">Team</param>
 /// <param name="ballcarrier">Player</param>
 public RunPlay(ChainCrew cc, Team offense, Team defense, Player ballcarrier, CarryStatSheet runStats) : base(cc, offense, defense)
 {
     this.principalBallcarrier = ballcarrier;
     this.runStats             = runStats;
 }
예제 #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="game">Game</param>
 /// <param name="cc">ChainCrew</param>
 /// <param name="scoringPlay">Play</param>
 public Touchdown(Game game, ChainCrew cc, Play scoringPlay)
 {
     this.game        = game;
     this.cc          = cc;
     this.scoringPlay = scoringPlay;
 }
예제 #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cc">ChainCrew</param>
 /// <param name="thrower">Player</param>
 /// <param name="defender">Player</param>
 public Interception(ChainCrew cc, Player thrower, Team defense) : base(thrower, defense)
 {
     this.cc = cc;
     this.originalBallcarrier  = thrower;
     this.principalBallcarrier = defense.TeamOffense.GetPlayerAtPosition("TB");
 }