コード例 #1
0
        private void ApplyOutcome(Result result)
        {
            if (_result.HasValue)
                throw new InvalidOperationException("TestResultShim status should only be set once.");

            _result = result;
        }
コード例 #2
0
        private bool CheckAndTransferToResult()
        {
            Debug.Assert(!IsResult, "phase is already result.");

            if (ForceResultInNextTick == Result.Lose || BattleRule.CheckLose(_context))
            {
                ForceResultInNextTick = null;
                Transfer(ResultLost);
                return true;
            }

            if (ForceResultInNextTick == Result.Win || BattleRule.CheckWin(_context))
            {
                ForceResultInNextTick = null;
                Transfer(ResultWon);
                return true;
            }

            return false;
        }