/// <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; }
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; }
/// <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); }
/// <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; }
//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); }
/// <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"); }
/// <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; }
/// <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]; }
/// <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); }
/// <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; }
/// <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; }
/// <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"); }