public override bool Equals(object other) { //Check for null and compare run-time types. if ((other == null) || !this.GetType().Equals(other.GetType())) { return(false); } else { Candy c = (Candy)other; return((this.candyName == c.GetCandyName()) && (this.candyColour == c.GetCandyColour())); } }
public string ToString() { return("TimedCandy: " + candy.GetCandyName() + " " + candy.GetCandyColour() + " " + spawnRate + " " + waitTime); }