Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/BasicGarbage.cs

32 lines
890 B
C#
Raw Normal View History

2019-04-23 06:32:35 +02:00
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);
}
}
}