private void RaiseGameEnded(GameTeam winningTeam, ChickenUnitLogic winningLogic) { UpdateLastGamePresentation(); _winningTeam.Value = winningTeam; var e = new GameEndedEventArgs(winningTeam, winningLogic); OnGameEnded(e); }
/// <summary> /// Initializes a new instance of the <see cref="GameEndedEventArgs"/> class. /// </summary> internal GameEndedEventArgs(GameTeam winningTeam, ChickenUnitLogic winningLogic) { #region Argument Check if (winningLogic == null ^ winningTeam == GameTeam.None) { throw new ArgumentException("Invalid combination of argument values."); } #endregion this.WinningTeam = winningTeam; this.WinningLogic = winningLogic; }
/// <summary> /// Initializes a new instance of the <see cref="LogicInfo"/> class. /// </summary> internal LogicInfo(Type type) { #region Argument Check if (type == null) { throw new ArgumentNullException("type"); } #endregion var caption = ChickenUnitLogic.GetCaption(type); if (caption.IsNullOrWhiteSpace()) { throw new ArgumentException( string.Format(CultureInfo.InvariantCulture, "Logic '{0}' has empty caption.", type.FullName), "type"); } this.Type = type; this.Caption = caption; _asString = string.Format("{0} ({1})", caption, type.Name); }