32 lines
890 B
C#
32 lines
890 B
C#
using System;
|
|
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces;
|
|
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces.Garbage;
|
|
|
|
namespace CzokoŚmieciarka.MonoGameView.DataModels.GeneralModels.Models
|
|
{
|
|
public class BasicGarbage : AGarbage
|
|
{
|
|
public BasicGarbage(ITypeOfGarbage typeOfGarbage, double weight) : base(typeOfGarbage, weight)
|
|
{
|
|
}
|
|
|
|
protected override AGarbage Add(AGarbage garbageToAdd)
|
|
{
|
|
return new BasicGarbage(TypeOfGarbage, Weight + garbageToAdd.Weight);
|
|
|
|
}
|
|
|
|
protected override AGarbage Subtract(AGarbage garbageToSubtract)
|
|
{
|
|
return new BasicGarbage(TypeOfGarbage, Weight - garbageToSubtract.Weight);
|
|
|
|
}
|
|
|
|
|
|
public override object Clone()
|
|
{
|
|
return new BasicGarbage((ITypeOfGarbage)TypeOfGarbage.Clone(), Weight);
|
|
}
|
|
}
|
|
}
|