SquadCA RegisterNewSquad(IBot bot, SquadTypeCA type, Actor target = null)
        {
            var ret = new SquadCA(bot, this, type, target);

            SquadsCA.Add(ret);
            return(ret);
        }
Esempio n. 2
0
        public SquadCA(IBot bot, SquadManagerBotModuleCA squadManager, SquadTypeCA type, Actor target)
        {
            Bot               = bot;
            SquadManager      = squadManager;
            World             = bot.Player.PlayerActor.World;
            Random            = World.LocalRandom;
            Type              = type;
            Target            = Target.FromActor(target);
            FuzzyStateMachine = new StateMachineCA();

            switch (type)
            {
            case SquadTypeCA.Assault:
            case SquadTypeCA.Rush:
                FuzzyStateMachine.ChangeState(this, new GroundUnitsIdleState(), true);
                break;

            case SquadTypeCA.Air:
                FuzzyStateMachine.ChangeState(this, new AirIdleState(), true);
                break;

            case SquadTypeCA.Protection:
                FuzzyStateMachine.ChangeState(this, new UnitsForProtectionIdleState(), true);
                break;

            case SquadTypeCA.Naval:
                FuzzyStateMachine.ChangeState(this, new NavyUnitsIdleState(), true);
                break;
            }
        }
 // HACK: Use of this function requires that there is one squad of this type.
 SquadCA GetSquadOfType(SquadTypeCA type)
 {
     return(SquadsCA.FirstOrDefault(s => s.Type == type));
 }
Esempio n. 4
0
 public SquadCA(IBot bot, SquadManagerBotModuleCA squadManager, SquadTypeCA type)
     : this(bot, squadManager, type, null)
 {
 }