Merge remote-tracking branch 'origin/main' into feature/#362-final-depth-sort-fix
# Conflicts: # src/entities/base/mapObject.ts # src/events/gameMaster/assetManager/mapObject/update.ts
This commit is contained in:
@ -16,11 +16,14 @@ export class BaseCharacterHair extends BaseEntity {
|
||||
@Property()
|
||||
gender: CharacterGender = CharacterGender.MALE
|
||||
|
||||
@Property()
|
||||
color: string = '#000000'
|
||||
|
||||
@Property()
|
||||
isSelectable = false
|
||||
|
||||
@ManyToOne()
|
||||
sprite?: Sprite
|
||||
sprite!: Sprite
|
||||
|
||||
@Property()
|
||||
createdAt = new Date()
|
||||
@ -55,6 +58,15 @@ export class BaseCharacterHair extends BaseEntity {
|
||||
return this.gender
|
||||
}
|
||||
|
||||
setColor(color: string) {
|
||||
this.color = color
|
||||
return this
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return this.color
|
||||
}
|
||||
|
||||
setIsSelectable(isSelectable: boolean) {
|
||||
this.isSelectable = isSelectable
|
||||
return this
|
||||
|
@ -25,8 +25,8 @@ export class BaseItem extends BaseEntity {
|
||||
@Enum(() => ItemRarity)
|
||||
rarity: ItemRarity = ItemRarity.COMMON
|
||||
|
||||
@ManyToOne(() => Sprite)
|
||||
sprite?: Sprite
|
||||
@ManyToOne()
|
||||
sprite!: Sprite
|
||||
|
||||
@Property()
|
||||
createdAt = new Date()
|
||||
|
@ -11,7 +11,7 @@ export class BaseMap extends BaseEntity {
|
||||
id = randomUUID()
|
||||
|
||||
@Property()
|
||||
name!: string
|
||||
name: string = ''
|
||||
|
||||
@Property()
|
||||
width = 10
|
||||
@ -19,7 +19,7 @@ export class BaseMap extends BaseEntity {
|
||||
@Property()
|
||||
height = 10
|
||||
|
||||
@Property({ type: 'json', nullable: true })
|
||||
@Property({ type: 'json' })
|
||||
tiles: Array<Array<string>> = []
|
||||
|
||||
@Property()
|
||||
|
@ -17,12 +17,12 @@ export class BaseMapEventTile extends BaseEntity {
|
||||
type!: MapEventTileType
|
||||
|
||||
@Property()
|
||||
positionX!: number
|
||||
positionX: number = 0
|
||||
|
||||
@Property()
|
||||
positionY!: number
|
||||
positionY: number = 0
|
||||
|
||||
@OneToOne({ eager: true })
|
||||
@OneToOne({ eager: true, deleteRule: 'cascade', orphanRemoval: true })
|
||||
teleport?: MapEventTileTeleport
|
||||
|
||||
setId(id: UUID) {
|
||||
|
@ -9,7 +9,7 @@ export class BaseMapEventTileTeleport extends BaseEntity {
|
||||
@PrimaryKey()
|
||||
id = randomUUID()
|
||||
|
||||
@OneToOne({ deleteRule: 'cascade' })
|
||||
@OneToOne({ deleteRule: 'cascade', orphanRemoval: true })
|
||||
mapEventTile!: MapEventTile
|
||||
|
||||
@ManyToOne({ deleteRule: 'cascade', eager: true })
|
||||
|
@ -16,6 +16,9 @@ export class BaseMapObject extends BaseEntity {
|
||||
@Property({ type: 'json' })
|
||||
depthOffsets = [0]
|
||||
|
||||
@Property({ type: 'json' })
|
||||
pivotPoints: { x: number; y: number }[] = []
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2 })
|
||||
originX = 0
|
||||
|
||||
@ -66,6 +69,10 @@ export class BaseMapObject extends BaseEntity {
|
||||
|
||||
setDepthOffsets(offsets: any) {
|
||||
this.depthOffsets = offsets
|
||||
}
|
||||
|
||||
setPivotPoints(pivotPoints: { x: number; y: number }[]) {
|
||||
this.pivotPoints = pivotPoints
|
||||
return this
|
||||
}
|
||||
|
||||
|
@ -11,9 +11,15 @@ export class BaseSprite extends BaseEntity {
|
||||
@Property()
|
||||
name!: string
|
||||
|
||||
@OneToMany(() => SpriteAction, (action) => action.sprite)
|
||||
@OneToMany({ mappedBy: 'sprite', orphanRemoval: true })
|
||||
spriteActions = new Collection<SpriteAction>(this)
|
||||
|
||||
@Property({ nullable: true })
|
||||
width: number | null = null
|
||||
|
||||
@Property({ nullable: true })
|
||||
height: number | null = null
|
||||
|
||||
@Property()
|
||||
createdAt = new Date()
|
||||
|
||||
@ -47,6 +53,24 @@ export class BaseSprite extends BaseEntity {
|
||||
return this.spriteActions
|
||||
}
|
||||
|
||||
setWidth(width: number | null) {
|
||||
this.width = width
|
||||
return this
|
||||
}
|
||||
|
||||
getWidth() {
|
||||
return this.width
|
||||
}
|
||||
|
||||
setHeight(height: number | null) {
|
||||
this.height = height
|
||||
return this
|
||||
}
|
||||
|
||||
getHeight() {
|
||||
return this.height
|
||||
}
|
||||
|
||||
setCreatedAt(createdAt: Date) {
|
||||
this.createdAt = createdAt
|
||||
return this
|
||||
|
Reference in New Issue
Block a user