Esempio n. 1
0
 // ctor: create a new animal on the specified position of the given world
 public Animal(AdvancedWatorWorld 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;
 }
Esempio n. 2
0
 // create and initialize a shark on the specified position in the given world
 public Shark(AdvancedWatorWorld world, Point position, int energy)
     : base(world, position)
 {
     Energy = energy;
 }
Esempio n. 3
0
 // create and initialize a new fish on the specified position of the given world
 public Fish(AdvancedWatorWorld world, Point position, int age)
     : base(world, position)
 {
     Energy = world.InitialFishEnergy;
     Age    = age;
 }