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

32 lines
918 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
{
2019-05-13 18:15:48 +02:00
public BasicGarbage(TypeOfGarbage typeOfGarbage, double weight) : base(typeOfGarbage, weight)
2019-04-23 06:32:35 +02:00
{
}
protected override AGarbage Add(AGarbage garbageToAdd)
{
2019-05-13 18:15:48 +02:00
return new BasicGarbage((TypeOfGarbage)TypeOfGarbage, Weight + garbageToAdd.Weight);
2019-04-23 06:32:35 +02:00
}
protected override AGarbage Subtract(AGarbage garbageToSubtract)
{
2019-05-13 18:15:48 +02:00
return new BasicGarbage((TypeOfGarbage)TypeOfGarbage, Weight - garbageToSubtract.Weight);
2019-04-23 06:32:35 +02:00
}
public override object Clone()
{
2019-05-13 18:15:48 +02:00
return new BasicGarbage((TypeOfGarbage)TypeOfGarbage.Clone(), Weight);
2019-04-23 06:32:35 +02:00
}
}
}