Exemplo n.º 1
0
        public static void That(Func <bool> condition,
                                string errorMesssage,
                                GamesViolationCodes violationCode)
        {
            if (condition == null)
            {
                throw new InvalidOperationException("Game rule condition must be set");
            }

            if (!condition())
            {
                throw new GameRulesViolationException(errorMesssage, violationCode);
            }
        }
Exemplo n.º 2
0
 public GameRulesViolationException(string errorMessage,
                                    GamesViolationCodes errorCode) : base(errorMessage)
 {
     ErrorCode = errorCode;
 }