Example #1
0
        private int PushIntoSlots(CmpButton[] aControls, AnimalAge eAge, int nFillCount, ref Random randGenerator)
        {
            bool[] abUsedSlots = new bool[3];
            int    nIDCount, nCurrent;

            Array.Clear(abUsedSlots, 0, abUsedSlots.Length);
            nIDCount = 3;

            for (int i = 0; i < 3; i++)
            {
                nCurrent = randGenerator.Next() % (nIDCount--);

                for (int j = 0, q = 0; j < 3; j++)
                {
                    if (abUsedSlots[j])
                    {
                        continue;
                    }

                    if (q == nCurrent)
                    {
                        abUsedSlots[j]           = true;
                        m_aAnimals[nFillCount++] = new CmpAnimal(this, aControls[j], m_aLastTypes[i], eAge);
                        break;
                    }

                    q++;
                }
            }

            return(nFillCount);
        }
Example #2
0
        public Fox(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_FOX;
            m_asImages = new string[] { "/Image/gait/fox/giphy_1.png", "/Image/CmpGM/AnimalChildren/fox.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/fox.png";
            m_sLabelImage      = "/Image/SelGM/fox.png";

            m_aeFood = new FoodBase.FoodType[3]
            {
                FoodBase.FoodType.FT_RODENT,
                FoodBase.FoodType.FT_BUG,
                FoodBase.FoodType.FT_BERRY,
            };
        }
Example #3
0
        public Hare(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_HARE;
            m_asImages = new string[] { "/Image/gait/hare/1.png", "/Image/CmpGM/AnimalChildren/hare.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/hare.png";
            m_sLabelImage      = "/Image/SelGM/hare.png";

            m_aeFood = new FoodBase.FoodType[3]
            {
                FoodBase.FoodType.FT_CARROT,
                FoodBase.FoodType.FT_PLANT,
                FoodBase.FoodType.FT_HAY,
            };
        }
Example #4
0
        public Wolf(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_WOLF;
            m_asImages = new string[] { "/Image/gait/wolf/1.png", "/Image/CmpGM/AnimalChildren/wolf.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/wolf.png";
            m_sLabelImage      = "/Image/SelGM/wolf.png";

            m_aeFood = new FoodBase.FoodType[3]
            {
                FoodBase.FoodType.FT_RODENT,
                FoodBase.FoodType.FT_BUG,
                FoodBase.FoodType.FT_BERRY,
            };
        }
Example #5
0
        public Squirrel(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_SQUIRREL;
            m_asImages = new string[] { "/Image/gait/squirrel/1.png", "/Image/CmpGM/AnimalChildren/squirrel.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/squirrel.png";
            m_sLabelImage      = "/Image/SelGM/squirrel.png";

            m_aeFood = new FoodBase.FoodType[3]
            {
                FoodBase.FoodType.FT_RODENT,
                FoodBase.FoodType.FT_BUG,
                FoodBase.FoodType.FT_BERRY,
            };
        }
Example #6
0
        public CmpAnimal(CmpGame parent, CmpButton control, AnimalType eType, AnimalAge eAge)
        {
            m_Parent  = parent;
            m_Control = control;

            switch (eType)
            {
            case AnimalType.AT_BEAR:
                m_Animal = new Bear(eAge);
                break;

            case AnimalType.AT_ELK:
                m_Animal = new Elk(eAge);
                break;

            case AnimalType.AT_FOX:
                m_Animal = new Fox(eAge);
                break;

            case AnimalType.AT_HARE:
                m_Animal = new Hare(eAge);
                break;

            case AnimalType.AT_HEDGEHOG:
                m_Animal = new Hedgehog(eAge);
                break;

            case AnimalType.AT_LYNX:
                m_Animal = new Lynx(eAge);
                break;

            case AnimalType.AT_SQUIRREL:
                m_Animal = new Squirrel(eAge);
                break;

            case AnimalType.AT_WOLF:
                m_Animal = new Wolf(eAge);
                break;
            }

            m_Control.SetCallback(this);
            m_Control.SetImage(m_Animal.GetImagePath());
            Uncheck();
            Enable();
        }
Example #7
0
        public Bear(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_BEAR;
            m_asImages = new string[] { "/Image/gait/bear/giphy_1.png", "/Image/CmpGM/AnimalChildren/bear.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/bear.png";
            m_sLabelImage      = "/Image/SelGM/bear.png";

            m_aeFood = new FoodBase.FoodType[11]
            {
                FoodBase.FoodType.FT_CARROT,
                FoodBase.FoodType.FT_PLANT,
                FoodBase.FoodType.FT_FISH,
                FoodBase.FoodType.FT_HAY,
                FoodBase.FoodType.FT_APPLE,
                FoodBase.FoodType.FT_RODENT,
                FoodBase.FoodType.FT_BUG,
                FoodBase.FoodType.FT_NUTS,
                FoodBase.FoodType.FT_SNAIL,
                FoodBase.FoodType.FT_WORM,
                FoodBase.FoodType.FT_BERRY,
            };
        }
Example #8
0
        public Hedgehog(AnimalAge eAge)
        {
            m_eAge     = eAge;
            m_eType    = AnimalType.AT_HEDGEHOG;
            m_asImages = new string[] { "/Image/gait/hedgehog/1.png", "/Image/CmpGM/AnimalChildren/hedgehog.png" };

            m_sCmpSuccessImage = "/Image/CmpGM/AnimalCmpSuccess/hedgehog.png";
            m_sLabelImage      = "/Image/SelGM/hedgehog.png";

            m_aeFood = new FoodBase.FoodType[11]
            {
                FoodBase.FoodType.FT_CARROT,
                FoodBase.FoodType.FT_PLANT,
                FoodBase.FoodType.FT_FISH,
                FoodBase.FoodType.FT_HAY,
                FoodBase.FoodType.FT_APPLE,
                FoodBase.FoodType.FT_RODENT,
                FoodBase.FoodType.FT_BUG,
                FoodBase.FoodType.FT_NUTS,
                FoodBase.FoodType.FT_SNAIL,
                FoodBase.FoodType.FT_WORM,
                FoodBase.FoodType.FT_BERRY,
            };
        }
Example #9
0
 public AnimalTypeData()
 {
     TypeAge = new AnimalAge();
     Animals = new List <Animal>();
     Owners  = new HashSet <string>();
 }