summaryrefslogtreecommitdiffstats
path: root/src/model/data/entity.ts
blob: 3474a38856ccc74be61ca31c29fd18564861dd07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Collision } from './collision';

export interface EntityDataInput {
	readonly sprite: string;
	readonly anchor?: [number, number];
	readonly collision?: Collision[];
}

export class EntityData {
	public readonly sprite: string;
	public readonly anchor: [number, number];
	public readonly collision: Collision[];

	constructor(input: EntityDataInput) {
		this.sprite = input.sprite;
		this.anchor = input.anchor || [0.5, 0.5];
		this.collision = input.collision || [];
	}
}