Пример #1
0
        ///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + Algae.GetHashCode();
                hash = (hash * 29) + Value.GetHashCode();
            }

            return(hash);
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();


            SeaWeed seeWeed = new SeaWeed()
            {
                Name = "Sea Weed"
            };

            Food fishFood = new Food()
            {
                Name     = "Fish Food",
                Calories = 10
            };

            Algae algae = new Algae()
            {
                Name     = "Algae",
                Calories = 45
            };

            Goldfish swimShady = new Goldfish()
            {
                Name                = "Swim Shady",
                Age                 = 1,
                Color               = "Orange",
                NumberOfFins        = 1,
                CreatureSound       = CreaturesOfTheSeaGUI.Resource.Fish,
                HungerLevelProgress = SwimShadyProgress
            };

            Pufferfish phat = new Pufferfish()
            {
                Name                = "Phat",
                Age                 = 7,
                Color               = "Yellow",
                NumberOfFins        = 5,
                CreatureSound       = CreaturesOfTheSeaGUI.Resource.Fish,
                HungerLevelProgress = PhatProgress
            };

            SeaTurtle crush = new SeaTurtle()
            {
                Name                = "Crush",
                Age                 = 150,
                Color               = "Green",
                HasTail             = true,
                CreatureSound       = CreaturesOfTheSeaGUI.Resource.Turtle,
                HungerLevelProgress = CrushProgress
            };

            Reptile waterDragon = new Reptile()
            {
                Name                = "Water Dragon",
                Age                 = 2,
                Color               = "Green",
                HasTail             = true,
                CreatureSound       = CreaturesOfTheSeaGUI.Resource.Whale,
                HungerLevelProgress = WaterDragonProgress
            };


            Creatures = new List <Creature>()
            {
                swimShady,
                phat,
                crush,
                waterDragon
            };

            Items = new List <Item>()
            {
                fishFood,
                algae,
                seeWeed
            };
        }