/// <summary> /// Create and run next command, when the player makes descision related to the current command /// </summary> /// <param name="player">The player of the quest.</param> public void Update(IReciver player) { if (!Enum.TryParse(player.CommandType, out _questStep)) { throw new InvalidCastException($"The {player.CommandType} command doesn't defind for the quest."); } if (_questStep == QuestStep.ReceiveRewardCommand) { return; } var command = CommandFactory(player); _commandInvoker.SetCommand(command); }
public void IssueCommand(ICommand command) { _invoker.SetCommand(command); _invoker.InvokeCommand(); }