UNPKG

ts-ritofile

Version:

TypeScript library for reading and writing League of Legends game file formats

25 lines (21 loc) 651 B
import { JsonSerializable } from '../core/json-encoder'; import { Vector } from './vector'; export class BoundingBox implements JsonSerializable { public min_vec: Vector; public max_vec: Vector; constructor(min_vec: Vector, max_vec: Vector) { this.min_vec = min_vec; this.max_vec = max_vec; } toString(): string { const min = this.min_vec; const max = this.max_vec; return `${min.x}, ${min.y}, ${min.z} ${max.x}, ${max.y}, ${max.z}`; } toJSON(): { min_vec: number[]; max_vec: number[] } { return { min_vec: this.min_vec.toJSON(), max_vec: this.max_vec.toJSON() }; } }