Raccoon walks around badly
This commit is contained in:
@ -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[][];
|
||||
|
Reference in New Issue
Block a user