forked from noxious/server
Almost finalised refactoring
This commit is contained in:
@ -26,10 +26,7 @@ export class CharacterType extends BaseEntity {
|
||||
@Property()
|
||||
isSelectable = false
|
||||
|
||||
@OneToMany(() => Character, (character) => character.characterType)
|
||||
characters = new Collection<Character>(this)
|
||||
|
||||
@ManyToOne(() => Sprite, { nullable: true })
|
||||
@ManyToOne({ nullable: true })
|
||||
sprite?: Sprite
|
||||
|
||||
@Property()
|
||||
@ -109,13 +106,4 @@ export class CharacterType extends BaseEntity {
|
||||
getUpdatedAt() {
|
||||
return this.updatedAt
|
||||
}
|
||||
|
||||
setCharacters(characters: Collection<Character>) {
|
||||
this.characters = characters
|
||||
return this
|
||||
}
|
||||
|
||||
getCharacters() {
|
||||
return this.characters
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import { MapEventTileTeleport } from './mapEventTileTeleport'
|
||||
|
||||
import { BaseEntity } from '#application/base/baseEntity'
|
||||
import { UUID } from '#application/types'
|
||||
import { placedMapObject } from '#entities/placedMapObject'
|
||||
import { PlacedMapObject } from '#entities/placedMapObject'
|
||||
|
||||
@Entity()
|
||||
export class Map extends BaseEntity {
|
||||
@ -47,8 +47,8 @@ export class Map extends BaseEntity {
|
||||
@OneToMany(() => MapEventTileTeleport, (teleport) => teleport.toMap)
|
||||
mapEventTileTeleports = new Collection<MapEventTileTeleport>(this)
|
||||
|
||||
@OneToMany(() => placedMapObject, (object) => object.map)
|
||||
placedMapObjects = new Collection<placedMapObject>(this)
|
||||
@OneToMany(() => PlacedMapObject, (object) => object.map)
|
||||
placedMapObjects = new Collection<PlacedMapObject>(this)
|
||||
|
||||
@OneToMany(() => Character, (character) => character.map)
|
||||
characters = new Collection<Character>(this)
|
||||
@ -155,7 +155,7 @@ export class Map extends BaseEntity {
|
||||
return this.mapEventTileTeleports
|
||||
}
|
||||
|
||||
setPlacedMapObjects(placedMapObjects: Collection<placedMapObject>) {
|
||||
setPlacedMapObjects(placedMapObjects: Collection<PlacedMapObject>) {
|
||||
this.placedMapObjects = placedMapObjects
|
||||
return this
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ export class MapObject extends BaseEntity {
|
||||
@Property({ type: 'json', nullable: true })
|
||||
tags?: any
|
||||
|
||||
@Property()
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2 })
|
||||
originX = 0
|
||||
|
||||
@Property()
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2 })
|
||||
originY = 0
|
||||
|
||||
@Property()
|
||||
|
@ -10,7 +10,7 @@ import { MapObject } from '#entities/mapObject'
|
||||
|
||||
//@TODO : Rename mapObject
|
||||
@Entity()
|
||||
export class placedMapObject extends BaseEntity {
|
||||
export class PlacedMapObject extends BaseEntity {
|
||||
@PrimaryKey()
|
||||
id = randomUUID()
|
||||
|
||||
|
Reference in New Issue
Block a user