48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
|
|
using CzokoŚmieciarka.DataModels.Models;
|
|
|
|
namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector
|
|
{
|
|
public abstract class AGarbageCollector : IGarbageCollector
|
|
{
|
|
public AGarbageCollector(Coords startPosition, IEnumerable<AGarbageCollectorContainer> trashContainers)
|
|
{
|
|
this.Coords = startPosition;
|
|
this.TrashContainers = trashContainers;
|
|
}
|
|
public Coords Coords { get; set; }
|
|
|
|
public Coords MoveUp()
|
|
{
|
|
return new Coords(Coords.X,Coords.Y+1);
|
|
}
|
|
|
|
public Coords MoveDown()
|
|
{
|
|
return new Coords(Coords.X, Coords.Y - 1);
|
|
}
|
|
|
|
public Coords MoveLeft()
|
|
{
|
|
return new Coords(Coords.X-1, Coords.Y);
|
|
}
|
|
|
|
public Coords MoveRight()
|
|
{
|
|
return new Coords(Coords.X+1, Coords.Y);
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
return this.MemberwiseClone();
|
|
}
|
|
|
|
public IEnumerable<AGarbageCollectorContainer> TrashContainers { get; }
|
|
}
|
|
}
|