forked from noxious/server
Added getter & setter functions to all entities
This commit is contained in:
@ -5,6 +5,7 @@ import { SpriteAction } from './spriteAction'
|
||||
import { CharacterType } from './characterType'
|
||||
import { CharacterHair } from './characterHair'
|
||||
import { Item } from './item'
|
||||
import { UUID } from '#application/types'
|
||||
|
||||
@Entity()
|
||||
export class Sprite extends BaseEntity {
|
||||
@ -31,4 +32,40 @@ export class Sprite extends BaseEntity {
|
||||
|
||||
@OneToMany(() => Item, (item) => item.sprite)
|
||||
items = new Collection<Item>(this)
|
||||
|
||||
setId(id: UUID) {
|
||||
this.id = id
|
||||
return this
|
||||
}
|
||||
|
||||
getId() {
|
||||
return this.id
|
||||
}
|
||||
|
||||
setName(name: string) {
|
||||
this.name = name
|
||||
return this
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setCreatedAt(createdAt: Date) {
|
||||
this.createdAt = createdAt
|
||||
return this
|
||||
}
|
||||
|
||||
getCreatedAt() {
|
||||
return this.createdAt
|
||||
}
|
||||
|
||||
setUpdatedAt(updatedAt: Date) {
|
||||
this.updatedAt = updatedAt
|
||||
return this
|
||||
}
|
||||
|
||||
getUpdatedAt() {
|
||||
return this.updatedAt
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user