Example #1
0
 // ctor: create a new animal on the specified position of the given world
 public Animal(OriginalWatorWorld world, Point position)
 {
     World    = world;
     Position = position;
     Age      = 0;
     Moved    = true;
     Energy   = 0;
     // place the new animal in the world
     World.Grid[position.X, position.Y] = this;
 }
Example #2
0
 // create and initialize a new fish on the specified position of the given world
 public Fish(OriginalWatorWorld world, Point position, int age)
     : base(world, position)
 {
     Energy = world.InitialFishEnergy;
     Age    = age;
 }
Example #3
0
 // create and initialize a shark on the specified position in the given world
 public Shark(OriginalWatorWorld world, Point position, int energy)
     : base(world, position)
 {
     Energy = energy;
 }