Rename Controls component variable accessing engine
This commit is contained in:
parent
17697070ee
commit
72ce25a806
2 changed files with 8 additions and 8 deletions
|
@ -15,27 +15,27 @@ import 'package:rules_of_living/service/engine_service.dart';
|
|||
styleUrls: const ["controls_component.css"],
|
||||
)
|
||||
class ControlsComponent {
|
||||
final EngineService ctrl;
|
||||
final EngineService engine;
|
||||
|
||||
ControlsComponent(this.ctrl);
|
||||
ControlsComponent(this.engine);
|
||||
|
||||
void onStartClicked() {
|
||||
ctrl.toggleRunning();
|
||||
engine.toggleRunning();
|
||||
}
|
||||
|
||||
void onStepClicked() {
|
||||
ctrl.step();
|
||||
engine.step();
|
||||
}
|
||||
|
||||
void onResetClicked() {
|
||||
ctrl.reset();
|
||||
engine.reset();
|
||||
}
|
||||
|
||||
void onRandomClicked() {
|
||||
ctrl.addRandomPattern();
|
||||
engine.addRandomPattern();
|
||||
}
|
||||
|
||||
void onClearClicked() {
|
||||
ctrl.clear();
|
||||
engine.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div id="controls">
|
||||
<material-button id="reset" (click)="onResetClicked()"><material-icon icon="replay" baseline></material-icon></material-button>
|
||||
<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="true" icon="pause" baseline></material-icon>
|
||||
</span>
|
||||
|
|
Loading…
Reference in a new issue