Beispiel #1
0
 /// <summary>
 /// Adds a leaf for this zombie to be 'watching.'
 /// </summary>
 /// <param name="leaf">Leaf to be watched.</param>
 public void assignLeaf(Leaf leaf)
 {
     this.brokenLeaf = leaf;
 }
Beispiel #2
0
 /// <summary>
 /// Removes a leaf from the list
 /// </summary>
 /// <param name="leaf">The leaf to remove</param>
 public void removeLeaf(Leaf leaf)
 {
     this.watchedLeaves.Remove(leaf);
 }
Beispiel #3
0
 /// <summary>
 /// Adds a leaf to the list
 /// </summary>
 /// <param name="leaf">The leaf to add</param>
 public void addLeaf(Leaf leaf)
 {
     this.watchedLeaves.AddFirst(leaf);
 }
Beispiel #4
0
 /// <summary>
 /// Moves the Zombie towards the newly broken leaf.
 /// </summary>
 /// <param name="leaf">The leaf that was broken by Darwin</param>
 public void goToLeaf(Leaf leaf)
 {
     // do this better later
     if (this.X < leaf.X)
         this.MoveRight();
     else if (this.X > leaf.X)
         this.MoveLeft();
     else if (this.Y < leaf.Y)
         this.MoveDown();
     else if (this.Y > leaf.Y)
         this.MoveUp();
 }