示例#1
0
        private bool IsAllowedAction(BaGuaElement action)
        {
            if (_actionExecutor != null)
            {
                return(false);
            }

            //TODO more accurate calculation of can execute option
            return(action.GetAvailableOptions(_currentPlayer, this).Any());
        }
示例#2
0
        internal void SelectAction(BaGuaElement action)
        {
            if (!IsAllowedAction(action))
            {
                throw new InvalidOperationException("Can't select this action now");
            }

            var options = action.GetAvailableOptions(_currentPlayer, this);

            _actionExecutor = new ActionExecutor(options, _currentPlayer, this);
        }