| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- class Position {
- const Position(this.x, this.y);
- final int x;
- final int y;
- bool isBefore(Position another) {
- if (another == null) {
- return false;
- }
- return another.y > y || (another.y == y && another.x > x);
- }
- bool isAfter(Position another) {
- if (another == null) {
- return false;
- }
- return another.y < y || (another.y == y && another.x < x);
- }
- bool isBeforeOrSame(Position another) {
- if (another == null) {
- return false;
- }
- return another.y > y || (another.y == y && another.x >= x);
- }
- bool isAfterOrSame(Position another) {
- if (another == null) {
- return false;
- }
- return another.y < y || (another.y == y && another.x <= x);
- }
- @override
- String toString() {
- return 'MouseOffset($x, $y)';
- }
- }
|