More map editor work

This commit is contained in:
2025-01-05 04:52:16 +01:00
parent 33afef5466
commit 57b21f1499
6 changed files with 27 additions and 46 deletions

View File

@ -14,6 +14,11 @@ export abstract class BaseEntity {
return this.entityManager
}
public setEntityManager(entityManager: EntityManager) {
this.entityManager = entityManager
return this
}
async save(): Promise<this> {
return this.execute('persist', 'save entity')
}
@ -22,7 +27,11 @@ export abstract class BaseEntity {
return this.execute('remove', 'remove entity')
}
private async execute(method: 'persist' | 'remove', actionDescription: string): Promise<this> {
async update(): Promise<this> {
return this.execute('merge', 'update entity')
}
private async execute(method: 'persist' | 'merge' | 'remove', actionDescription: string): Promise<this> {
try {
const em = this.getEntityManager()