コード例 #1
0
ファイル: MainRegister.cs プロジェクト: Theo-Farnole/Tartaros
    public OverallActionData GetOverallActionData(OverallAction overallAction)
    {
        Assert.IsNotNull(_overallActionsRegister);
        Assert.IsTrue(_overallActionsRegister.ContainsKey(overallAction),
                      string.Format(debugLogHeader + "OverallAction: {0} doesn't exist in register.", overallAction));

        return(_overallActionsRegister[overallAction]);
    }
コード例 #2
0
        public static Action ToOrder(this OverallAction overallAction)
        {
            switch (overallAction)
            {
            case OverallAction.Stop:
                return(() => SelectedGroupsActionsCaller.OrderStop());

            case OverallAction.Move:
                return(() => SecondClickListener.Instance.ListenToMove());

            case OverallAction.Attack:
                return(() => SecondClickListener.Instance.ListenToAttack());

            case OverallAction.Patrol:
                return(() => SecondClickListener.Instance.ListenToPatrol());

            case OverallAction.MoveAggressively:
                return(() => SecondClickListener.Instance.ListenToMoveAggresively());

            default:
                throw new NotImplementedException(string.Format("Please, implement {0} enum.", overallAction));
            }
        }