Exemplo n.º 1
0
    public override void OnCommandReceived(string username, string message)
    {
        if (username == _player.Name)
        {
            this.HandleMessage("!" + message);
            ActionChoiceResult res = _player.TryActionCommand(message);
            switch (res.state)
            {
            case ActionChoiceResult.State.UNMATCHED:
                this.EchoMessage(string.Format(ActionListenerResponse.InvalidAction, username));
                break;

            case ActionChoiceResult.State.QUEUED:
                if (GameManager.Instance.battleComponents.turnManager.GetPhase().CanInputActions())
                {
                    this.EchoMessage(string.Format(ActionListenerResponse.ThisTurnAction, username, res.GetAmalgamatedMessage()));
                }
                else
                {
                    this.EchoMessage(string.Format(ActionListenerResponse.NextTurnAction, username, res.GetAmalgamatedMessage()));
                }
                break;

            default:
                this.EchoMessage(string.Format(ActionListenerResponse.GenericResponse, username, res.GetAmalgamatedMessage()));
                break;
            }
        }
    }