Пример #1
0
        //public void GrowWaterWood()
        //{
        //    if (Temperature >= 21 && AllFish.draw.Light)
        //    {
        //        int ran = rnd.Next(0, 2);
        //        if (something.Trees[ran].height.Count <= 10)
        //            something.Trees[ran].Grow();
        //    }
        //}

        public void GrowFish(Graphics g)
        {
            for (int i = 0; i < AllFish.residents.Count; i++)
            {
                if (AllFish.residents[i] is FishChild)
                {
                    if (AllFish.residents[i].Width == 50)
                    {
                        AllFish.residents[i].Width  = 100;
                        AllFish.residents[i].Height = 63;
                    }
                    else
                    {
                        AllFish.Add(new FishAdult(g, AllFish.residents[i].X, AllFish.residents[i].Y));
                        AllFish.residents[AllFish.residents.Count - 1].health = AllFish.residents[i].health;
                        AllFish.residents.RemoveAt(i);
                    }
                }
            }
        }
Пример #2
0
        public void NormConditions(Graphics g)
        {
            switch (sexSubscribers.Count)
            {
            case 0:
                for (int i = 0; i < AllFish.residents.Count(); i++)
                {
                    if (AllFish.residents[i].health > 65 && AllFish.residents[i] is FishAdult)
                    {
                        sexSubscribers.Add((AllFish.residents[i] as FishAdult));
                    }
                    if (sexSubscribers.Count == 2)
                    {
                        break;
                    }
                }
                break;

            case 1:
                sexSubscribers = new List <IsexSub>();
                break;

            case 2:
                int    TrgX = Middle((sexSubscribers[0] as LiveInAqua).X, (sexSubscribers[1] as LiveInAqua).X);
                int    TrgY = Middle((sexSubscribers[0] as LiveInAqua).Y, (sexSubscribers[1] as LiveInAqua).Y);
                double a    = sexSubscribers[0].GoSex(TrgX, TrgY);
                double b    = sexSubscribers[1].GoSex(TrgX, TrgY);
                if (a < 75)
                {
                    AllFish.Add(new FishChild(g, TrgX + 67, TrgY + 50));
                    sexSubscribers = new List <IsexSub>();
                    sexflag        = false;
                }
                break;
            }
        }
Пример #3
0
 public void Add(LiveInAqua obj)
 {
     AllFish.Add(obj);
 }
Пример #4
0
 public void AddFish(LiveInAqua fish)
 {
     AllFish.Add(fish);
 }