parent
800c85d14f
commit
b1221c7c84
3 changed files with 42 additions and 5 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:angular/angular.dart';
|
||||
import 'package:angular_components/material_button/material_button.dart';
|
||||
import 'package:angular_components/material_icon/material_icon.dart';
|
||||
import 'package:angular_components/material_input/material_input.dart';
|
||||
import 'package:angular_components/material_input/material_number_accessor.dart';
|
||||
import 'package:angular_components/material_slider/material_slider.dart';
|
||||
import 'package:angular_components/material_tooltip/material_tooltip.dart';
|
||||
import 'package:rules_of_living/service/configuration_service.dart';
|
||||
|
|
@ -8,18 +10,35 @@ import 'package:rules_of_living/service/configuration_service.dart';
|
|||
@Component(
|
||||
selector: "configuration",
|
||||
templateUrl: "configuration_component.html",
|
||||
styleUrls: ["configuration_component.css"],
|
||||
styleUrls: [
|
||||
"configuration_component.css"
|
||||
],
|
||||
directives: [
|
||||
MaterialButtonComponent,
|
||||
MaterialIconComponent,
|
||||
MaterialSliderComponent,
|
||||
MaterialTooltipDirective
|
||||
MaterialTooltipDirective,
|
||||
materialInputDirectives,
|
||||
materialNumberInputDirectives,
|
||||
NgModel
|
||||
])
|
||||
class ConfigurationComponent {
|
||||
final ConfigurationService config;
|
||||
|
||||
int get width => config.gridSize.x;
|
||||
void set width(num value) {
|
||||
if (value == null || value <= 0) return;
|
||||
config.setGridSize(x: value.toInt());
|
||||
}
|
||||
|
||||
int get height => config.gridSize.y;
|
||||
void set height(num value) {
|
||||
if (value == null || value <= 0) return;
|
||||
config.setGridSize(y: value.toInt());
|
||||
}
|
||||
|
||||
int get simSpeed => config.simSpeed;
|
||||
int set simSpeed(int value) => config.simSpeed = value;
|
||||
void set simSpeed(int value) => config.simSpeed = value;
|
||||
|
||||
String get speedSliderTooltip => "Simulation Speed: $simSpeed";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue