Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }