forked from noxious/server
npm run format
This commit is contained in:
@ -1,37 +1,37 @@
|
||||
import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
|
||||
import { Sprite } from './sprite';
|
||||
import { CharacterItem } from './characterItem';
|
||||
import { ItemType, ItemRarity } from '#utilities/enums';
|
||||
import { Sprite } from './sprite'
|
||||
import { CharacterItem } from './characterItem'
|
||||
import { ItemType, ItemRarity } from '#utilities/enums'
|
||||
|
||||
@Entity()
|
||||
export class Item {
|
||||
@PrimaryKey()
|
||||
id!: string;
|
||||
id!: string
|
||||
|
||||
@Property()
|
||||
name!: string;
|
||||
name!: string
|
||||
|
||||
@Property({ nullable: true })
|
||||
description?: string;
|
||||
description?: string
|
||||
|
||||
@Enum(() => ItemType)
|
||||
itemType!: ItemType;
|
||||
itemType!: ItemType
|
||||
|
||||
@Property()
|
||||
stackable = false;
|
||||
stackable = false
|
||||
|
||||
@Enum(() => ItemRarity)
|
||||
rarity: ItemRarity = ItemRarity.COMMON;
|
||||
rarity: ItemRarity = ItemRarity.COMMON
|
||||
|
||||
@ManyToOne(() => Sprite, { nullable: true })
|
||||
sprite?: Sprite;
|
||||
sprite?: Sprite
|
||||
|
||||
@Property()
|
||||
createdAt = new Date();
|
||||
createdAt = new Date()
|
||||
|
||||
@Property()
|
||||
updatedAt = new Date();
|
||||
updatedAt = new Date()
|
||||
|
||||
@OneToMany(() => CharacterItem, characterItem => characterItem.item)
|
||||
characters = new Collection<CharacterItem>(this);
|
||||
}
|
||||
@OneToMany(() => CharacterItem, (characterItem) => characterItem.item)
|
||||
characters = new Collection<CharacterItem>(this)
|
||||
}
|
||||
|
Reference in New Issue
Block a user