Rename Controls component variable accessing engine

This commit is contained in:
Unknown 2018-10-18 11:59:36 +02:00
parent 17697070ee
commit 72ce25a806
2 changed files with 8 additions and 8 deletions

View file

@ -15,27 +15,27 @@ import 'package:rules_of_living/service/engine_service.dart';
styleUrls: const ["controls_component.css"], styleUrls: const ["controls_component.css"],
) )
class ControlsComponent { class ControlsComponent {
final EngineService ctrl; final EngineService engine;
ControlsComponent(this.ctrl); ControlsComponent(this.engine);
void onStartClicked() { void onStartClicked() {
ctrl.toggleRunning(); engine.toggleRunning();
} }
void onStepClicked() { void onStepClicked() {
ctrl.step(); engine.step();
} }
void onResetClicked() { void onResetClicked() {
ctrl.reset(); engine.reset();
} }
void onRandomClicked() { void onRandomClicked() {
ctrl.addRandomPattern(); engine.addRandomPattern();
} }
void onClearClicked() { void onClearClicked() {
ctrl.clear(); engine.clear();
} }
} }

View file

@ -1,7 +1,7 @@
<div id="controls"> <div id="controls">
<material-button id="reset" (click)="onResetClicked()"><material-icon icon="replay" baseline></material-icon></material-button> <material-button id="reset" (click)="onResetClicked()"><material-icon icon="replay" baseline></material-icon></material-button>
<material-button id="run" (click)="onStartClicked()"> <material-button id="run" (click)="onStartClicked()">
<span [ngSwitch]="ctrl.isRunning"> <span [ngSwitch]="engine.isRunning">
<material-icon *ngSwitchCase="false" icon="play_arrow" baseline></material-icon> <material-icon *ngSwitchCase="false" icon="play_arrow" baseline></material-icon>
<material-icon *ngSwitchCase="true" icon="pause" baseline></material-icon> <material-icon *ngSwitchCase="true" icon="pause" baseline></material-icon>
</span> </span>