2019-04-23 06:32:35 +02:00
|
|
|
|
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;
|
2019-04-22 14:55:47 +02:00
|
|
|
|
using MonoGameView.DataModels.Models;
|
2019-04-23 06:32:35 +02:00
|
|
|
|
using CzokoŚmieciarka.MonoGameView.DataModels.GeneralModels.Models;
|
2019-04-22 14:55:47 +02:00
|
|
|
|
|
2019-04-23 06:32:35 +02:00
|
|
|
|
namespace CzokoŚmieciarka.MonoGameView.DataModels.Models
|
|
|
|
|
{
|
|
|
|
|
public class GarbageCollector : AGarbageCollector, IDrawables
|
|
|
|
|
{
|
2019-04-23 11:24:07 +02:00
|
|
|
|
public GarbageCollector(Coords c, List<GarbageCollectorContainer> l, int rows, int cols,int houseCounter, int counter = 0) : base(c,l,rows,cols,houseCounter,counter)
|
2019-04-23 06:32:35 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Draw(SpriteBatch batch,int size)
|
|
|
|
|
{
|
|
|
|
|
batch.Draw(ImageContainer.GetImage("collector"), new Rectangle(Coords.X*500/size, Coords.Y*500/size, 500/size, 500/size), Color.White);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override object Clone()
|
|
|
|
|
{
|
2019-05-13 18:15:48 +02:00
|
|
|
|
if (TrashContainers.Any(x=>x.FillPercent > 0))
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine();
|
|
|
|
|
}
|
2019-04-23 06:32:35 +02:00
|
|
|
|
var cloneList = TrashContainers.Select(x=>(GarbageCollectorContainer)x.Clone()).ToList();
|
2019-04-23 11:24:07 +02:00
|
|
|
|
return new GarbageCollector((Coords)Coords.Clone(), cloneList, rows,columns, HouseCounter,Counter);
|
2019-04-23 06:32:35 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|