Raccoon walks around badly

This commit is contained in:
2025-02-01 23:33:41 -08:00
parent 46a249352d
commit dfae5b2405
9 changed files with 302 additions and 160 deletions

View File

@ -82,6 +82,20 @@ export class Size {
}
}
export class Rect {
readonly top: Point;
readonly size: Size;
constructor(top: Point, size: Size) {
this.top = top;
this.size = size;
}
contains(other: Point) {
return (other.x >= this.top.x && other.y >= this.top.y && other.x < this.top.x + this.size.w && other.y < this.top.y + this.size.h);
}
}
export class Grid<T> {
readonly size: Size;
#data: T[][];