49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CzokoŚmieciarka.MonoGameView.DataModels.Interfaces.Garbage
|
|
{
|
|
public abstract class AGarbage : IGarbage
|
|
{
|
|
protected AGarbage(ITypeOfGarbage typeOfGarbage, double weight)
|
|
{
|
|
this.TypeOfGarbage = typeOfGarbage;
|
|
this.Weight = weight;
|
|
}
|
|
|
|
public ITypeOfGarbage TypeOfGarbage { get; }
|
|
|
|
public virtual double Weight { get; set; }
|
|
|
|
public virtual double Volume
|
|
{
|
|
get { return (double) this.Weight / TypeOfGarbage.Density; }
|
|
}
|
|
|
|
protected abstract AGarbage Add(AGarbage garbageToAdd);
|
|
protected abstract AGarbage Subtract (AGarbage garbageToSubtract);
|
|
|
|
#region Operators
|
|
|
|
public static AGarbage operator + (AGarbage a, AGarbage b)
|
|
{
|
|
return a.Add(b);
|
|
}
|
|
|
|
public static AGarbage operator - (AGarbage a, AGarbage b)
|
|
{
|
|
return a.Subtract(b);
|
|
}
|
|
|
|
#endregion
|
|
|
|
public virtual object Clone()
|
|
{
|
|
return new NotImplementedException("xD");
|
|
}
|
|
}
|
|
}
|