Add grid changing function
This commit is contained in:
parent
5e8f83cf8a
commit
9886f13d69
2 changed files with 39 additions and 15 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:rules_of_living/service/engine_service.dart';
|
||||
|
||||
class ConfigurationService {
|
||||
|
|
@ -26,4 +28,10 @@ class ConfigurationService {
|
|||
void toggleGrid() {
|
||||
showGrid = !showGrid;
|
||||
}
|
||||
}
|
||||
|
||||
void setGridSize({int x, int y}) {
|
||||
x = x ?? engineService.engine.gridSize.x;
|
||||
y = y ?? engineService.engine.gridSize.y;
|
||||
engineService.engine.gridSize = Point(x, y);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue