forked from noxious/server
27 lines
691 B
TypeScript
27 lines
691 B
TypeScript
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
|
|
import { BaseEntity } from '#application/bases/baseEntity'
|
|
import { Character } from './character'
|
|
import { Sprite } from './sprite'
|
|
import { CharacterGender } from '#application/enums'
|
|
|
|
@Entity()
|
|
export class CharacterHair extends BaseEntity {
|
|
@PrimaryKey()
|
|
id!: number
|
|
|
|
@Property()
|
|
name!: string
|
|
|
|
@Property()
|
|
gender: CharacterGender = CharacterGender.MALE
|
|
|
|
@Property()
|
|
isSelectable = false
|
|
|
|
@ManyToOne(() => Sprite, { nullable: true })
|
|
sprite?: Sprite
|
|
|
|
@OneToMany(() => Character, (character) => character.characterHair)
|
|
characters = new Collection<Character>(this)
|
|
}
|