// Use this for initialization void Start() { movementModule = GetComponent<MovementModule>(); trackingModule = GetComponent<TrackingModule>(); loadoutModule = GetComponent<AircraftLoadout>(); fireControlModule = GetComponent<AircraftFireControl>(); }
public TrackingModuleFixture() { _xpTracking = new Mock <IXpTracking>(); var module = new TrackingModule(_xpTracking.Object); _browser = BrowserBuilder.CreateNullBrowserForLogicTests(module); }
public void Move(Orientation testOrientation, int expectedXPosition, int expectedYPosition) { const int testX = 2; const int testY = 2; var testPosition = new Position(testX, testY, testOrientation); const int testGridSizeX = 3; const int testGridSizeY = 3; var testTrackingModule = new TrackingModule { GridMaximumX = testGridSizeX, GridMaximumY = testGridSizeY, Position = testPosition }; var spyCommand = new SpyCommand(); var moveCommand = new MoveForwardCommand(spyCommand); moveCommand.Execute(testTrackingModule); var actualTrackingModule = spyCommand.TrackingModule; actualTrackingModule.Position.Y.Should().Be(expectedYPosition); actualTrackingModule.Position.X.Should().Be(expectedXPosition); }
public void Execute(TrackingModule trackingModule) { var newPositionX = trackingModule.Position.X - 1; if (newPositionX >= trackingModule.GridMinimumX) { trackingModule.Position.X = newPositionX; } }
public void Execute(TrackingModule trackingModule) { var newPositionY = trackingModule.Position.Y - 1; if (newPositionY >= trackingModule.GridMinimumY) { trackingModule.Position.Y = newPositionY; } }
public void NotDecrementXAxisOfPositionWhenAtMinimumXAxis() { var testTrackingModule = new TrackingModule() { GridMaximumX = 2, GridMaximumY = 2, Position = new Position(1, 2, Orientation.W) }; var testMoveWestCommand = new MoveWestCommand(); testMoveWestCommand.Execute(testTrackingModule); var position = testTrackingModule.Position; position.Y.Should().Be(2); position.X.Should().Be(1); position.Orientation.Should().Be(Orientation.W); }
public void NotIncrementYAxisPositionWhenAtMaximumYAxis() { var testTrackingModule = new TrackingModule() { GridMaximumX = 2, GridMaximumY = 2, Position = new Position(1, 2, Orientation.N) }; var testMoveNorthCommand = new MoveNorthCommand(); testMoveNorthCommand.Execute(testTrackingModule); var position = testTrackingModule.Position; position.Y.Should().Be(2); position.X.Should().Be(1); position.Orientation.Should().Be(Orientation.N); }
public void IncrementXAxisOfPosition() { var testTrackingModule = new TrackingModule() { GridMaximumX = 2, GridMaximumY = 2, Position = new Position(1, 1, Orientation.E) }; var testMoveEastCommand = new MoveEastCommand(); testMoveEastCommand.Execute(testTrackingModule); var position = testTrackingModule.Position; position.Y.Should().Be(1); position.X.Should().Be(2); position.Orientation.Should().Be(Orientation.E); }
public void DecrementYAxisOfPosition() { var testTrackingModule = new TrackingModule() { GridMaximumX = 2, GridMaximumY = 2, Position = new Position(2, 2, Orientation.S) }; var testMoveSouthCommand = new MoveSouthCommand(); testMoveSouthCommand.Execute(testTrackingModule); var position = testTrackingModule.Position; position.Y.Should().Be(1); position.X.Should().Be(2); position.Orientation.Should().Be(Orientation.S); }
public TopicSubscriberSelfDestroyingTopicWrapper(BusManager busManager, SubscriberSettings <TMessage> subscriberSettings, ITopicNameGetter topicNameGetter, IMessageSerializer <TMessage> messageSerializer, ILogger logger, TrackingModule trackingModule) { _topicName = topicNameGetter.Get <TMessage>(subscriberSettings); _busSubscriber = new TopicSubscriberV2 <TMessage>( busManager, subscriberSettings, topicNameGetter, messageSerializer, logger, trackingModule); UsedTopics.Add(_topicName); }
public void RotateToNextOrientationOnLCommand(Orientation testOrientation, Orientation expectedOrientation) { const int dummyX = 1; const int dummyY = 1; var testPosition = new Position(dummyX, dummyY, testOrientation); const int testGridSizeX = 3; const int testGridSizeY = 3; var testTrackingModule = new TrackingModule { GridMaximumX = testGridSizeX, GridMaximumY = testGridSizeY, Position = testPosition }; var spyCommand = new SpyCommand(); var rotateCommand = new RotateRightCommand(spyCommand); rotateCommand.Execute(testTrackingModule); var actualTrackingModule = spyCommand.TrackingModule; actualTrackingModule.Position.Orientation.Should().Be(expectedOrientation); }
private static void MoveForward(TrackingModule trackingModule) { var command = MoveForwardCommandFactory.Create(trackingModule.Position.Orientation); command.Execute(trackingModule); }
public void Execute(TrackingModule trackingModule) { TrackingModule = trackingModule; }
public void Execute(TrackingModule trackingModule) { _command?.Execute(trackingModule); }
// Use this for initialization void Start() { ArmSamSite(); trackingModule = GetComponent<TrackingModule>(); }
// Use this for initialization void Start() { movementModule = GetComponent<MovementModule>(); trackingModule = GetComponent<TrackingModule>(); }
public void Execute(TrackingModule trackingModule) { MoveForward(trackingModule); _nextCommandInChain?.Execute(trackingModule); }