dungeon-sdk-drikkx
Version:
Shared types and entities for the Dungeon game
83 lines • 3.66 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DungeonWaveEntity = void 0;
const typeorm_1 = require("typeorm");
const dungeon_types_1 = require("../types/dungeon.types");
const dungeon_room_entity_1 = require("./dungeon-room.entity");
const combat_action_entity_1 = require("./combat-action.entity");
let DungeonWaveEntity = class DungeonWaveEntity {
constructor(partial) {
Object.assign(this, partial);
}
};
exports.DungeonWaveEntity = DungeonWaveEntity;
__decorate([
(0, typeorm_1.PrimaryColumn)(),
__metadata("design:type", String)
], DungeonWaveEntity.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", String)
], DungeonWaveEntity.prototype, "roomId", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => dungeon_room_entity_1.DungeonRoomEntity, room => room.waves),
__metadata("design:type", dungeon_room_entity_1.DungeonRoomEntity)
], DungeonWaveEntity.prototype, "room", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", Number)
], DungeonWaveEntity.prototype, "waveNumber", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'enum',
enum: dungeon_types_1.WaveStatus,
default: dungeon_types_1.WaveStatus.PENDING
}),
__metadata("design:type", String)
], DungeonWaveEntity.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ default: false }),
__metadata("design:type", Boolean)
], DungeonWaveEntity.prototype, "completed", void 0);
__decorate([
(0, typeorm_1.Column)('jsonb'),
__metadata("design:type", Array)
], DungeonWaveEntity.prototype, "enemies", void 0);
__decorate([
(0, typeorm_1.Column)('jsonb'),
__metadata("design:type", Array)
], DungeonWaveEntity.prototype, "rewards", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
__metadata("design:type", Date)
], DungeonWaveEntity.prototype, "startTime", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
__metadata("design:type", Date)
], DungeonWaveEntity.prototype, "endTime", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp' }),
__metadata("design:type", Date)
], DungeonWaveEntity.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
__metadata("design:type", Date)
], DungeonWaveEntity.prototype, "completedAt", void 0);
__decorate([
(0, typeorm_1.OneToMany)(() => combat_action_entity_1.CombatActionEntity, action => action.wave),
__metadata("design:type", Array)
], DungeonWaveEntity.prototype, "combatActions", void 0);
exports.DungeonWaveEntity = DungeonWaveEntity = __decorate([
(0, typeorm_1.Entity)('dungeon_waves'),
__metadata("design:paramtypes", [Object])
], DungeonWaveEntity);
//# sourceMappingURL=dungeon-wave.entity.js.map