forked from noxious/server
Updated entity
This commit is contained in:
parent
da2df6ace6
commit
eaa7385acc
@ -6,6 +6,14 @@ import { BaseEntity } from '#application/base/baseEntity'
|
|||||||
import { UUID } from '#application/types'
|
import { UUID } from '#application/types'
|
||||||
import { Sprite } from '#entities/sprite'
|
import { Sprite } from '#entities/sprite'
|
||||||
|
|
||||||
|
export interface SpriteImage {
|
||||||
|
url: string
|
||||||
|
offset: {
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class BaseSpriteAction extends BaseEntity {
|
export class BaseSpriteAction extends BaseEntity {
|
||||||
@PrimaryKey()
|
@PrimaryKey()
|
||||||
id = randomUUID()
|
id = randomUUID()
|
||||||
@ -17,7 +25,7 @@ export class BaseSpriteAction extends BaseEntity {
|
|||||||
action!: string
|
action!: string
|
||||||
|
|
||||||
@Property({ type: 'json', nullable: true })
|
@Property({ type: 'json', nullable: true })
|
||||||
sprites?: string[]
|
sprites?: SpriteImage[]
|
||||||
|
|
||||||
@Property({ type: 'decimal', precision: 5, scale: 2 })
|
@Property({ type: 'decimal', precision: 5, scale: 2 })
|
||||||
originX = 0.0
|
originX = 0.0
|
||||||
@ -61,7 +69,7 @@ export class BaseSpriteAction extends BaseEntity {
|
|||||||
return this.action
|
return this.action
|
||||||
}
|
}
|
||||||
|
|
||||||
setSprites(sprites: string[]) {
|
setSprites(sprites: SpriteImage[]) {
|
||||||
this.sprites = sprites
|
this.sprites = sprites
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user