コード例 #1
0
        public bool Eat(Herd DeerHerd)
        {
            if (DeerHerd.GetCount() >= 12)
            {
                DeerHerd.Kill(0);
                return(true);
            }

            else
            {
                return(false);
            }
        }
コード例 #2
0
        public void Hunt(Herd DeerHerd)
        {
            List <int> DeadWolves = new List <int>();

            for (int i = 0; i < Wolves.Count; i++)
            {
                if (Wolves[i].Eat(DeerHerd) == false)
                {
                    DeadWolves.Add(i);
                }
            }

            for (int i = DeadWolves.Count - 1; i >= 0; i--)
            {
                Wolves.RemoveAt(DeadWolves[i]);
            }
        }