예제 #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;
 }
예제 #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);
 }
예제 #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);
 }
예제 #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();
 }