2019-03-13 14:19:38 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-03-13 17:23:52 +01:00
|
|
|
|
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
|
2019-03-13 14:19:38 +01:00
|
|
|
|
using CzokoŚmieciarka.DataModels.Models;
|
|
|
|
|
|
|
|
|
|
namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector
|
|
|
|
|
{
|
|
|
|
|
public abstract class AGarbageCollector : IGarbageCollector
|
|
|
|
|
{
|
|
|
|
|
public AGarbageCollector(Coords startPosition, IEnumerable<AGarbageCollectorContainer> trashContainers)
|
|
|
|
|
{
|
|
|
|
|
this.Position = startPosition;
|
|
|
|
|
this.TrashContainers = trashContainers;
|
|
|
|
|
}
|
2019-03-27 02:00:58 +01:00
|
|
|
|
public Coords Position { get; set; }
|
2019-03-13 14:19:38 +01:00
|
|
|
|
|
|
|
|
|
public Coords MoveUp()
|
|
|
|
|
{
|
|
|
|
|
return new Coords(Position.X,Position.Y+1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Coords MoveDown()
|
|
|
|
|
{
|
|
|
|
|
return new Coords(Position.X, Position.Y - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Coords MoveLeft()
|
|
|
|
|
{
|
|
|
|
|
return new Coords(Position.X-1, Position.Y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Coords MoveRight()
|
|
|
|
|
{
|
|
|
|
|
return new Coords(Position.X+1, Position.Y);
|
2019-03-26 19:37:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
{
|
|
|
|
|
return this.MemberwiseClone();
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 14:19:38 +01:00
|
|
|
|
public IEnumerable<AGarbageCollectorContainer> TrashContainers { get; }
|
|
|
|
|
}
|
|
|
|
|
}
|