/// <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; }
/// <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); }
/// <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); }
/// <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(); }