Пример #1
0
        public Squad(HackyAI bot, SquadT type, Actor target)
        {
            Bot               = bot;
            World             = bot.World;
            Random            = bot.Random;
            Type              = type;
            Target            = Target.FromActor(target);
            FuzzyStateMachine = new StateMachine();

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

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

            case SquadT.Protection:
                FuzzyStateMachine.ChangeState(this, new UnitsForProtectionIdleState(), true);
                break;
            }
        }
Пример #2
0
        Squad RegisterNewSquad(SquadT type, Actor target = null)
        {
            var ret = new Squad(this, type, target);

            Squads.Add(ret);
            return(ret);
        }
Пример #3
0
 Squad GetSquadOfType(SquadT type)
 {
     return(Squads.FirstOrDefault(s => s.Type == type));
 }
Пример #4
0
 public Squad(HackyAI bot, SquadT type) : this(bot, type, null)
 {
 }