dungeon-sdk-drikkx
Version:
Shared types and entities for the Dungeon game
31 lines (24 loc) • 756 B
text/typescript
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { CombatActionType } from '../types/combat.types';
import { DungeonWaveEntity } from './dungeon-wave.entity';
('combat_actions')
export class CombatActionEntity {
()
id!: number;
()
waveId!: number;
(() => DungeonWaveEntity, wave => wave.combatActions)
wave!: DungeonWaveEntity;
({
type: 'enum',
enum: CombatActionType
})
type!: CombatActionType;
('jsonb')
data!: Record<string, any>;
({ type: 'timestamp' })
createdAt!: Date;
constructor(partial: Partial<CombatActionEntity>) {
Object.assign(this, partial);
}
}