コード例 #1
0
ファイル: AIAgent.cs プロジェクト: feranmii/fer-tools
    private BaseState GetBehaviour(AIBehaviour behaviour)
    {
        BaseState retVal = null;

        switch (behaviour)
        {
        case AIBehaviour.Patrolling:
            retVal = new PatrolBehaviour(this);
            break;

        case AIBehaviour.Wander:
            retVal = new WanderBehaviour(this);
            break;

        case AIBehaviour.Skirmish:
            retVal = new SkirmishBehaviour(this);
            break;

        case AIBehaviour.ChargeTarget:
            retVal = new BerserkerBehaviour(this);
            break;

        case AIBehaviour.Cover:
            retVal = new TacticalBehaviour(this);
            break;

        case AIBehaviour.MoveToTransform:
            retVal = new MoveToTransformBehaviour(this);
            break;

        case AIBehaviour.Chase:
            retVal = new ChaseState(this);
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(behaviour), behaviour, null);
        }

        retVal.Enter();

        return(retVal);
    }