public int CompareTo(object obj) { Stockpile otherStockpile = (Stockpile)obj; if (StockPileNumber > otherStockpile.StockPileNumber) { return(1); } else if (StockPileNumber == otherStockpile.StockPileNumber) { return(0); } else { return(-1); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } else if (obj.GetType() != GetType()) { return(false); } Stockpile otherStockpile = (Stockpile)obj; if (Name == otherStockpile.Name && coal == otherStockpile.Coal && stockPileNumber == otherStockpile.StockPileNumber) { return(true); } return(false); }