private bool IsAllowedAction(BaGuaElement action) { if (_actionExecutor != null) { return(false); } //TODO more accurate calculation of can execute option return(action.GetAvailableOptions(_currentPlayer, this).Any()); }
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); }