Skip to content

Commit

Permalink
Merge pull request #236 from n8rzz/feature/ATC-181
Browse files Browse the repository at this point in the history
feature/ATC-181
  • Loading branch information
n8rzz authored Jan 23, 2017
2 parents 751640e + 43b2269 commit 64a565a
Show file tree
Hide file tree
Showing 5 changed files with 1,422 additions and 1,243 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Major
- Restructures `src` files into `client` and `server` folders. [#220](https://github.com/n8rzz/atc/issues/220)
- Updates Node to version 7.0.0 [#184](https://github.com/n8rzz/atc/issues/184)
- Moves aircraft command logic from `AircraftInstanceModel` to new `AircraftCommander` class [#181](https://github.com/n8rzz/atc/issues/181)

### Minor
- Changes `AircraftStripView` text outputs to be all uppercase [#193](https://github.com/n8rzz/atc/issues/193)
Expand Down
6 changes: 5 additions & 1 deletion src/assets/scripts/client/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LoadingView from './LoadingView';
import AirportController from './airport/AirportController';
import GameController from './game/GameController';
import TutorialView from './tutorial/TutorialView';
import AircraftCommander from './aircraft/AircraftCommander';
import InputController from './InputController';
import UiController from './UiController';
import CanvasController from './canvas/CanvasController';
Expand Down Expand Up @@ -57,6 +58,7 @@ export default class App {
this.contentQueue = null;
this.airportController = null;
this.tutorialView = null;
this.aircraftCommander = null;
this.inputController = null;
this.uiController = null;
this.canvasController = null;
Expand Down Expand Up @@ -104,8 +106,9 @@ export default class App {
this.airportController = new AirportController(airportLoadList, this.updateRun);
this.gameController = new GameController(this.getDeltaTime);
this.tutorialView = new TutorialView(this.$element);
this.inputController = new InputController(this.$element);
this.uiController = new UiController(this.$element);
this.aircraftCommander = new AircraftCommander(this.airportController, this.gameController, this.uiController);
this.inputController = new InputController(this.$element, this.aircraftCommander);
this.canvasController = new CanvasController(this.$element);
this.gameClockView = new GameClockView(this.$element);

Expand Down Expand Up @@ -163,6 +166,7 @@ export default class App {
this.airportController = null;
this.gameController = null;
this.tutorialView = null;
this.aircraftCommander = null;
this.inputController = null;
this.uiController = null;
this.canvasController = null;
Expand Down
6 changes: 4 additions & 2 deletions src/assets/scripts/client/InputController.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ export default class InputController {
/**
* @constructor
*/
constructor($element) {
constructor($element, aircraftCommander) {
this.$element = $element;
this.$window = null;
this.$commandInput = null;
this.$canvases = null;
this.$sidebar = null;

this._aircraftCommander = aircraftCommander;

this.input = input;
this.input.command = '';
this.input.callsign = '';
Expand Down Expand Up @@ -880,6 +882,6 @@ export default class InputController {

const aircraft = prop.aircraft.list[match];

return aircraft.runCommands(commandParser.args);
return this._aircraftCommander.runCommands(aircraft, commandParser.args);
}
}
Loading

0 comments on commit 64a565a

Please sign in to comment.