forked from noxious/server
Added ORM entities
This commit is contained in:
39
src/entities/spriteAction.ts
Normal file
39
src/entities/spriteAction.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Sprite } from './sprite';
|
||||
|
||||
@Entity()
|
||||
export class SpriteAction {
|
||||
@PrimaryKey()
|
||||
id = randomUUID();
|
||||
|
||||
@ManyToOne(() => Sprite)
|
||||
sprite!: Sprite;
|
||||
|
||||
@Property()
|
||||
action!: string;
|
||||
|
||||
@Property({ type: 'json', nullable: true })
|
||||
sprites?: any;
|
||||
|
||||
@Property()
|
||||
originX = 0;
|
||||
|
||||
@Property()
|
||||
originY = 0;
|
||||
|
||||
@Property()
|
||||
isAnimated = false;
|
||||
|
||||
@Property()
|
||||
isLooping = false;
|
||||
|
||||
@Property()
|
||||
frameWidth = 0;
|
||||
|
||||
@Property()
|
||||
frameHeight = 0;
|
||||
|
||||
@Property()
|
||||
frameRate = 0;
|
||||
}
|
Reference in New Issue
Block a user