/// <summary> /// Event handler for when a player empties their hand during a bout. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnHandEmpty(object sender, GameLogEventArgs e) { if (sender == Attacker) { Winner = Attacker; } else if (sender == Defender) { Winner = Defender; } }
protected virtual void OnNewBout(GameLogEventArgs l) { NewBout?.Invoke(this, l); }
protected virtual void OnEnd(GameLogEventArgs l) { this.IsOver = true; End?.Invoke(this, l); }
/// <summary> /// Simple output method to use in place of a game log for the next two tests /// </summary> static void _SpitToOutput(object sender, GameLogEventArgs e) { Console.WriteLine(e.Message); //Console.ReadKey(); }
protected virtual void OnDefend(GameActionEventArgs a, GameLogEventArgs l) { Defend?.Invoke(this, a); DefendLog?.Invoke(this, l); }
protected virtual void OnAttack(GameActionEventArgs a, GameLogEventArgs l) { Attack?.Invoke(this, a); AttackLog?.Invoke(this, l); }
protected virtual void OnHandEmpty(GameLogEventArgs l) { IsActive = false; HandEmpty?.Invoke(this, l); }
protected virtual void OnPickUp(GameLogEventArgs l) { PickUp?.Invoke(this, l); }
protected virtual void OnConcede(GameLogEventArgs l) { Concede?.Invoke(this, l); }
protected virtual void OnEnd(GameLogEventArgs l) { End?.Invoke(this, l); }
protected virtual void OnReport(GameLogEventArgs l) { Report?.Invoke(this, l); }