예제 #1
0
        public void CancelPlans(Location ant, params PlanType[] plans)
        {
            foreach (var plan in plans)
            {
                switch (plan)
                {
                case PlanType.Move:
                    MovePlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;

                case PlanType.Attack:
                    AttackPlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;

                case PlanType.Food:
                    FoodPlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;

                case PlanType.Hill:
                    FoodPlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;

                case PlanType.NewBorn:
                    NewBornPlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;

                case PlanType.Explore:
                    ExplorePlans.RemoveAll(x => x.Ant.EqualTo(ant));
                    break;
                }
            }
        }
예제 #2
0
        //public void ClearPlans()
        //{
        //    AttackPlans.Clear();
        //    FoodPlans.Clear();
        //    MovePlans.Clear();
        //    //NewBornPlans.Clear();
        //    MyFreeAnts.Clear();
        //}

        public void CancelOtherPlansForAnt(Location ant)
        {
            FoodPlans.RemoveAll(x => x.Ant.EqualTo(ant));
            AttackPlans.RemoveAll(x => x.Ant.EqualTo(ant));
            MovePlans.RemoveAll(x => x.Ant.EqualTo(ant));
            NewBornPlans.RemoveAll(x => x.Ant.EqualTo(ant));
            ExplorePlans.RemoveAll(x => x.Ant.EqualTo(ant));
        }