dungeon-sdk-drikkx
Version:
Shared types and entities for the Dungeon game
100 lines • 3.94 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.DungeonEntity = void 0;
const typeorm_1 = require("typeorm");
const dungeon_types_1 = require("../types/dungeon.types");
const dungeon_room_entity_1 = require("./dungeon-room.entity");
let DungeonEntity = class DungeonEntity {
constructor(partial) {
Object.assign(this, partial);
}
};
exports.DungeonEntity = DungeonEntity;
__decorate([
(0, typeorm_1.PrimaryColumn)(),
__metadata("design:type", String)
], DungeonEntity.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'enum',
enum: dungeon_types_1.DungeonTheme
}),
__metadata("design:type", String)
], DungeonEntity.prototype, "theme", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'enum',
enum: dungeon_types_1.DungeonDifficulty
}),
__metadata("design:type", String)
], DungeonEntity.prototype, "difficulty", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'enum',
enum: dungeon_types_1.DungeonStatus,
default: dungeon_types_1.DungeonStatus.WAITING
}),
__metadata("design:type", String)
], DungeonEntity.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ default: 0 }),
__metadata("design:type", Number)
], DungeonEntity.prototype, "currentRoom", void 0);
__decorate([
(0, typeorm_1.Column)({ default: 0 }),
__metadata("design:type", Number)
], DungeonEntity.prototype, "currentWave", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", Number)
], DungeonEntity.prototype, "totalRooms", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", Number)
], DungeonEntity.prototype, "totalWaves", void 0);
__decorate([
(0, typeorm_1.Column)('jsonb'),
__metadata("design:type", Array)
], DungeonEntity.prototype, "party", void 0);
__decorate([
(0, typeorm_1.Column)('jsonb', { nullable: true }),
__metadata("design:type", Array)
], DungeonEntity.prototype, "combatHistory", void 0);
__decorate([
(0, typeorm_1.Column)({ default: false }),
__metadata("design:type", Boolean)
], DungeonEntity.prototype, "completed", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)(),
__metadata("design:type", Date)
], DungeonEntity.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp' }),
__metadata("design:type", Date)
], DungeonEntity.prototype, "startedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
__metadata("design:type", Date)
], DungeonEntity.prototype, "completedAt", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", String)
], DungeonEntity.prototype, "createdById", void 0);
__decorate([
(0, typeorm_1.OneToMany)(() => dungeon_room_entity_1.DungeonRoomEntity, room => room.dungeon),
__metadata("design:type", Array)
], DungeonEntity.prototype, "rooms", void 0);
exports.DungeonEntity = DungeonEntity = __decorate([
(0, typeorm_1.Entity)('dungeons'),
__metadata("design:paramtypes", [Object])
], DungeonEntity);
//# sourceMappingURL=dungeon.entity.js.map