/// <summary> /// /// </summary> /// <param name="e"></param> protected virtual void OnPlayerAction(PlayerActionEventArgs e) { if (PlayerAction != null) { PlayerAction(this, e); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Participant_PlayerAction(object sender, PlayerActionEventArgs e) { Participant p = (Participant)sender; // action 1: place bomb if (e.Type == PlayerActionEventArgs.Types.Action1) { if (p.HasAuthority || p.ControlsPlayer(e.PlayerIndex)) { Players[e.PlayerIndex].PlaceBomb(Board); } else { System.Diagnostics.Debug.Assert(false, "Unauthorized Participant trying to control Player" + e.PlayerIndex); } } }