dartterm/lib/gen/requirement.dart

26 lines
613 B
Dart
Raw Permalink Normal View History

part of 'generator.dart';
class Requirement {
2023-09-21 05:00:45 +00:00
final int vxMin, vxMax, vyMin, vyMax;
final DirectionSet smooth;
2023-09-21 05:00:45 +00:00
Requirement(this.vxMin, this.vxMax, this.vyMin, this.vyMax, this.smooth) {
assert(vxMin <= vxMax);
assert(vyMin <= vyMax);
assert(vxMax > 2);
assert(vyMax > 2);
}
Requirement flip() {
2023-09-21 05:00:45 +00:00
return Requirement(vxMin, vxMax, vyMin, vyMax, smooth.flip());
}
Requirement rotateLeft() {
2023-09-21 05:00:45 +00:00
return Requirement(vyMin, vyMax, vxMin, vxMax, smooth.rotateLeft());
}
Requirement rotateRight() {
2023-09-21 05:00:45 +00:00
return Requirement(vyMin, vyMax, vxMin, vxMax, smooth.rotateRight());
}
}