public AlienArsenal(GameData gameData, Scene scene, TrajectoryController bulletController, ICollisionController collisionController) : base(gameData, scene, 0, 0) { this.AlienGroups = new List <AlienGroup>(); BulletController = bulletController; CollisionController = collisionController; }
public void FireAtWill(TrajectoryController bulletController, ICollisionController collisionController) { var positionabsolute = this.Bounds.Position + this.Bounds.OffsetPosition; positionabsolute.X += 3; positionabsolute.Y += 3; var bullet = new Bullet(GameData, Scene, 1, Direction.Up, NPPGames.Properties.Resources.SIAB) { EdgeOfScreenCondition = EdgeScreenHandling.Disappear, LayerOrder = int.MaxValue, TrajectoryController = bulletController, CollisionController = collisionController, Frequency = 2, Direction = Direction.Down, Type = SpriteTypes.ALIEN_BULLET, CollidesWithTypes = new List <string>() { SpriteTypes.PLAYER, SpriteTypes.PLAYER_BULLET } }; bullet.SetData("!"); bullet.RendererData.StepY = 1; bullet.Bounds.Position = positionabsolute; bullet.Fire(); Scene.AddSprite(bullet); }
public void SetUp() { _trackRemover = new TrackRemover(); _trackManagement = new TrackManagement(); _timeSpanCalculator = new TimeSpanCalculator(); _distanceCalculator = new DistanceCalculator(); _velocityCalculator = new VelocityCalculator(_timeSpanCalculator, _distanceCalculator); _velocityAnalyzer = new VelocityAnalyzer(_velocityCalculator); _compassCalculator = new CompassCalculator(); _courseAnalyzer = new CourseAnalyzer(_compassCalculator); _altitudeDistanceCalculator = new AltitudeDistanceCalculator(); _collisionAnalyzer = new CollisionAnalyzer(_distanceCalculator, _altitudeDistanceCalculator); _separationStringBuilder = new SeparationStringBuilder(); _fakeFileWriter = Substitute.For <IFileWriter>(); _airspace = new Airspace(); _airspaceTrackChecker = new AirspaceTrackChecker(_airspace); _fakeTransponderDataReciever = Substitute.For <ITransponderDataReciever>(); _airspaceController = new AirTrafficMonitoring.AirspaceController.AirspaceController(_fakeTransponderDataReciever, _airspaceTrackChecker); _flightManagement = new AirTrafficMonitoring.FlightManagement.FlightManagement(_airspaceController, _trackRemover, _trackManagement); _flightAnalyzer = new AirTrafficMonitoring.FlightAnalyzer.FlightAnalyzer(_flightManagement, _courseAnalyzer, _velocityAnalyzer); _collisionController = new AirTrafficMonitoring.CollisionController.CollisionController(_flightManagement, _collisionAnalyzer, _separationStringBuilder); _logger = new AirTrafficMonitoring.CollisionController.Logger(_collisionController, "", _fakeFileWriter); }
public void SetUp() { _distanceCalculator = new DistanceCalculator(); _altitudeDistanceCalculator = new AltitudeDistanceCalculator(); _collisionAnalyzer = new CollisionAnalyzer(_distanceCalculator, _altitudeDistanceCalculator); _separationStringBuilder = new SeparationStringBuilder(); _fakeFlightManagement = Substitute.For <IFlightManagement>(); _collisionController = new AirTrafficMonitoring.CollisionController.CollisionController(_fakeFlightManagement, _collisionAnalyzer, _separationStringBuilder); }
public Logger(ICollisionController collisionController, string loggingPath, IFileWriter fileWriter) { collisionController.SeperationEvent += LogSeparationEvent; _fileWriter = fileWriter; _loggingPath = loggingPath; }
public void SetUp() { _fakeCollisionController = Substitute.For <ICollisionController>(); _fakeFileWriter = Substitute.For <IFileWriter>(); }
public ConsoleDisplay(IFlightAnalyzer flightAnalyzer, ICollisionController collisionController) { flightAnalyzer.TracksAnalyzedEvent += DisplayTracks; collisionController.SeperationEvent += LogSeparationEvent; }