Ejemplo n.º 1
0
 public bool Equals(AbstractFurniture that)
 {
     if ((object)that == null)
     {
         return false;
     }
     if (that.fancyName.Equals(this.fancyName) && that.room == this.room && that.material == this.material && that.size.Equals(this.size) && that.price == this.price)
     {
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 public void addFurniture(AbstractFurniture furniture, Int32 count)
 {
     if (!this.items.ContainsKey(furniture))
     {
         this.items.Add(furniture, count);
     }
     else
     {
         Int32 prevCount = this.items[furniture];
         this.items[furniture] = prevCount + count;
         // or: this.items[furniture] += prevCount + count;
     }
 }
Ejemplo n.º 3
0
 private static void sellFurniture(AbstractFurniture furniture, int pieces )
 {
     Console.WriteLine(furniture.sell(pieces));
 }