dartterm/lib/gen/requirement.dart
2023-09-20 22:00:45 -07:00

26 lines
613 B
Dart

part of 'generator.dart';
class Requirement {
final int vxMin, vxMax, vyMin, vyMax;
final DirectionSet smooth;
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() {
return Requirement(vxMin, vxMax, vyMin, vyMax, smooth.flip());
}
Requirement rotateLeft() {
return Requirement(vyMin, vyMax, vxMin, vxMax, smooth.rotateLeft());
}
Requirement rotateRight() {
return Requirement(vyMin, vyMax, vxMin, vxMax, smooth.rotateRight());
}
}