Czoko_Smieciarka/Trunk/Components/CzokoŚmieciarka.DataModels/Models/Steps/MoveStep.cs

35 lines
1.0 KiB
C#
Raw Permalink Normal View History

2019-03-13 15:31:33 +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.Enums;
2019-03-13 15:31:33 +01:00
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
namespace CzokoŚmieciarka.DataModels.Models.Steps
{
public class MoveStep : IStep
{
public MoveStep(Direction direction, IGarbageCollector garbageCollector)
{
this._garbageCollector = garbageCollector;
this._direction = direction;
}
private Direction _direction;
private IGarbageCollector _garbageCollector;
public void Invoke()
{
switch (_direction)
{
case Direction.Up: _garbageCollector.MoveUp(); break;
case Direction.Down: _garbageCollector.MoveDown(); break;
case Direction.Left: _garbageCollector.MoveLeft(); break;
case Direction.Right: _garbageCollector.MoveRight(); break;
}
}
}
}