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

40 lines
1.5 KiB
C#

using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces.GarbageCollector;
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.MonoGameView.DataModels.Interfaces;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MonoGameView.DataModels.Models;
using CzokoŚmieciarka.MonoGameView.DataModels.GeneralModels.Models;
namespace CzokoŚmieciarka.MonoGameView.DataModels.Models
{
public class GarbageCollector : AGarbageCollector, IDrawables
{
public GarbageCollector(Coords c, List<GarbageCollectorContainer> l, int rows, int cols,int houseCounter, int counter = 0) : base(c,l,rows,cols,houseCounter,counter)
{
}
public void Draw(SpriteBatch batch,int size,int width)
{
batch.Draw(ImageContainer.GetImage("collector"), new Rectangle(Coords.X*width/size, Coords.Y*width/size, width/size, width/size), Color.White);
}
public override object Clone()
{
if (TrashContainers.Any(x=>x.FillPercent > 0))
{
Console.WriteLine();
}
var cloneList = TrashContainers.Select(x=>(GarbageCollectorContainer)x.Clone()).ToList();
return new GarbageCollector((Coords)Coords.Clone(), cloneList, rows,columns, HouseCounter,Counter);
}
}
}