internal override void TearDown() { base.TearDown(); if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) { player_TurnEnded(_TurnEndedPlayer, new TurnEndedEventArgs(_TurnEndedPlayer)); } _TurnEndedEventHandler = null; }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } _CardPlayedEventHandlers.Add(new Player.CardPlayedEventHandler(ActivePlayer_CardPlayed)); player.CardPlayed += _CardPlayedEventHandlers[_CardPlayedEventHandlers.Count - 1]; }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } _CostComputeEventHandlers.Add(new Game.CostComputeEventHandler(player_BridgePlayed)); player._Game.CostCompute += _CostComputeEventHandlers[_CostComputeEventHandlers.Count - 1]; player._Game.SendMessage(player, this, 1); }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) { _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; } _TurnEndedPlayer = null; _TurnEndedEventHandler = null; foreach (Player.CardPlayedEventHandler cpeh in _CardPlayedEventHandlers) { player.CardPlayed -= cpeh; } _CardPlayedEventHandlers.Clear(); }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) { _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; } _TurnEndedPlayer = null; _TurnEndedEventHandler = null; foreach (Game.CostComputeEventHandler cceh in _CostComputeEventHandlers) { player._Game.CostCompute -= cceh; } _CostComputeEventHandlers.Clear(); }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; _TurnEndedPlayer = null; _TurnEndedEventHandler = null; foreach (Player.CleaningUpEventHandler cueh in _CleaningUpEventHandlers) player.CleaningUp -= cueh; _CleaningUpEventHandlers.Clear(); }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } _CleaningUpEventHandlers.Add(new Player.CleaningUpEventHandler(player_CleaningUp)); player.CleaningUp += _CleaningUpEventHandlers.Last(); }
internal override void TearDown() { base.TearDown(); if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) player_TurnEnded(_TurnEndedPlayer, new TurnEndedEventArgs(_TurnEndedPlayer)); _TurnEndedEventHandler = null; }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } // Get the player to my left Player playerToLeft = player._Game.GetPlayerFromIndex(player, 1); Choice choice = new Choice(String.Format("Name a card {0} can't buy", player), this, player._Game.Table.Supplies, player, false); ChoiceResult result = playerToLeft.MakeChoice(choice); player._Game.SendMessage(playerToLeft, this, result.Supply); if (!_BuyCheckEventHandlers.ContainsKey(result.Supply)) { result.Supply.AddToken(new ContrabandToken()); _BuyCheckEventHandlers[result.Supply] = new Supply.BuyCheckEventHandler(Supply_BuyCheck); result.Supply.BuyCheck += _BuyCheckEventHandlers[result.Supply]; } }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; _TurnEndedPlayer = null; _TurnEndedEventHandler = null; foreach (Supply supply in _BuyCheckEventHandlers.Keys) supply.BuyCheck -= _BuyCheckEventHandlers[supply]; _BuyCheckEventHandlers.Clear(); }
internal override void TearDown() { base.TearDown(); foreach (Supply supply in _BuyCheckEventHandlers.Keys) supply.BuyCheck -= _BuyCheckEventHandlers[supply]; _BuyCheckEventHandlers.Clear(); if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) player_TurnEnded(_TurnEndedPlayer, new TurnEndedEventArgs(_TurnEndedPlayer)); _TurnEndedEventHandler = null; }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } _CostComputeEventHandlers.Add(new Game.CostComputeEventHandler(player_BridgePlayed)); player._Game.CostCompute += _CostComputeEventHandlers[_CostComputeEventHandlers.Count - 1]; player._Game.SendMessage(player, this, 1); }
public override void Play(Player player) { base.Play(player); if (_TurnEndedEventHandler == null) { _TurnEndedPlayer = player; _TurnEndedEventHandler = new Player.TurnEndedEventHandler(player_TurnEnded); player.TurnEnded += _TurnEndedEventHandler; } _CardPlayedEventHandlers.Add(new Player.CardPlayedEventHandler(ActivePlayer_CardPlayed)); player.CardPlayed += _CardPlayedEventHandlers[_CardPlayedEventHandlers.Count - 1]; }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; _TurnEndedPlayer = null; _TurnEndedEventHandler = null; foreach (Game.CostComputeEventHandler cceh in _CostComputeEventHandlers) player._Game.CostCompute -= cceh; _CostComputeEventHandlers.Clear(); }
void player_TurnEnded(object sender, TurnEndedEventArgs e) { Player player = sender as Player; if (_TurnEndedEventHandler != null && _TurnEndedPlayer != null) _TurnEndedPlayer.TurnEnded -= _TurnEndedEventHandler; _TurnEndedPlayer = null; _TurnEndedEventHandler = null; if (_CleaningUpEventHandler != null) player.CleaningUp -= _CleaningUpEventHandler; _CleaningUpEventHandler = null; }