public override void Move()
        {
            // Lose energy.
            Energy -= Ocean.SharkEnergyLoss;
            if (Energy == 0)
            {
                // Die.
                Ocean.Bitmap.SetPixel(X, Y, Color.Black);
                Ocean.Grid[X, Y] = null;
                Ocean.Sharks.Remove(this);
                return;
            }

            // Look for a free spot.
            List <Point> spots = Ocean.FreeSpots(X, Y, true);

            if (spots.Count == 0)
            {
                return;
            }

            // Move.
            Ocean.Bitmap.SetPixel(X, Y, Color.Black);
            Ocean.Grid[X, Y] = null;

            // See if the new spot contains food.
            Point moveTo = spots.Random();

            if (Ocean.Grid[moveTo.X, moveTo.Y] is Fish)
            {
                // Eat it.
                Energy += Ocean.FishEnergyValue;
                Fish fish = Ocean.Grid[moveTo.X, moveTo.Y] as Fish;
                Ocean.Fishes.Remove(fish);
            }

            // Move to the new spot.
            X = moveTo.X;
            Y = moveTo.Y;
            Ocean.Bitmap.SetPixel(X, Y, Fish.Color);
            Ocean.Grid[X, Y] = this;

            // Breed.
            Split();
        }
        public override void Move()
        {
            // Look for a free spot.
            List <Point> spots = Ocean.FreeSpots(X, Y, true);

            if (spots.Count > 0)
            {
                // Move.
                Ocean.Bitmap.SetPixel(X, Y, Color.Black);
                Ocean.Grid[X, Y] = null;

                Point moveTo = spots.Random();
                X = moveTo.X;
                Y = moveTo.Y;
                Ocean.Bitmap.SetPixel(X, Y, Fish.Color);
                Ocean.Grid[X, Y] = this;
            }

            // Breed.
            Breed();
        }
        // See if we should breed.
        private void Split()
        {
            if (Energy < Ocean.SharkSplitEnergy)
            {
                return;
            }

            // Split.
            Energy /= 2;

            // Position a child.
            List <Point> spots = Ocean.FreeSpots(X, Y, false);

            if (spots.Count == 0)
            {
                return;
            }

            Point childSpot = spots.Random();

            Ocean.Sharks.Add(new Shark(Ocean, Energy, childSpot.X, childSpot.Y));
        }
        // See if we should breed.
        private void Breed()
        {
            if (--TimeUntilBreeding > 0)
            {
                return;
            }

            // Breed.
            TimeUntilBreeding = Ocean.FishBreedingTime;

            // Position a child.
            List <Point> spots = Ocean.FreeSpots(X, Y, false);

            if (spots.Count == 0)
            {
                return;
            }

            Point childSpot = spots.Random();

            Ocean.Fishes.Add(new Fish(Ocean, Ocean.FishBreedingTime, childSpot.X, childSpot.Y));
        }