Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/Dump.cs
2019-05-14 23:05:37 +02:00

30 lines
1.2 KiB
C#

using System;
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces;
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.MonoGameView.DataModels.Models;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGameView.DataModels.Models;
namespace CzokoŚmieciarka.MonoGameView.DataModels.GeneralModels.Models
{
public class Dump : ADump, IDrawables
{
public Dump(ITypeOfGarbage typeOfGarbage, int maxVolume, Coords localization) : base(typeOfGarbage, maxVolume, localization)
{
}
public void Draw(SpriteBatch batch, int size, int width)
{
batch.Draw(ImageContainer.GetImage(TypeOfGarbage.GarbageType.ToString()), new Rectangle(Coords.X * width / size, Coords.Y * width / size, width / size, width / size), Color.White);
batch.Draw(ImageContainer.GetImage(TypeOfGarbage.GarbageType.ToString()+"Bar"), new Rectangle(Coords.X * width / size, Coords.Y * width / size, (int)Math.Round(FillPercent * width) / size, 50 / size), Color.White);
}
public override object Clone()
{
return new Dump((ITypeOfGarbage)TypeOfGarbage.Clone(), MaxVolume, (Coords)Coords.Clone());
}
}
}