-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoverDeployCommand.cs
35 lines (30 loc) · 955 Bytes
/
RoverDeployCommand.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Nasa.MarsRover.LandingSurface;
using Nasa.MarsRover.Rovers;
namespace Nasa.MarsRover.Command
{
public class RoverDeployCommand : IRoverDeployCommand
{
public Point DeployPoint { get; set; }
public CardinalDirection DeployDirection { get; set; }
private IRover rover;
private ILandingSurface landingSurface;
public RoverDeployCommand(Point aPoint, CardinalDirection aDirection)
{
DeployPoint = aPoint;
DeployDirection = aDirection;
}
public CommandType GetCommandType()
{
return CommandType.RoverDeployCommand;
}
public void Execute()
{
rover.Deploy(landingSurface, DeployPoint, DeployDirection);
}
public void SetReceivers(IRover aRover, ILandingSurface aLandingSurface)
{
rover = aRover;
landingSurface = aLandingSurface;
}
}
}