Skip to content
Snippets Groups Projects
coordinate.entity.ts 1.16 KiB
Newer Older
L4168's avatar
L4168 committed
import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
L4168's avatar
L4168 committed
  OneToMany,
L4168's avatar
L4168 committed
  ManyToOne,
L4168's avatar
L4168 committed
  PrimaryColumn,
L4168's avatar
L4168 committed
  Timestamp,
} from 'typeorm';
L4168's avatar
L4168 committed
import {
  Game_PersonEntity,
  ObjectivePointEntity,
  GameEntity,
} from './game.entity';
L4168's avatar
L4168 committed
import { FactionEntity } from './faction.entity';

@Entity('MapDrawing')
export class MapDrawingEntity {
  @PrimaryGeneratedColumn('uuid') mapDrawingId: string;
L4168's avatar
L4168 committed
  @Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
  @Column({ type: 'time', nullable: true }) drawingValidTill: string;
L4168's avatar
L4168 committed

  @Column({ type: 'json', nullable: true }) data: JSON;

L4168's avatar
L4168 committed
  @ManyToOne(type => FactionEntity, faction => faction.mapDrawings)
L4168's avatar
L4168 committed
  faction: FactionEntity;
  @ManyToOne(type => GameEntity, gameEntity => gameEntity.id)
  gameId: GameEntity;
}
L4168's avatar
L4168 committed

@Entity('Game_Person_MapDrawing')
export class Game_Person_MapDrawingEntity {
  @PrimaryGeneratedColumn('uuid') GPmapDrawingId: string;
  @Column({ type: 'timestamp' }) GPCTimeStamp: Timestamp;

  @ManyToOne(type => Game_PersonEntity, game_person => game_person.gamepersonId)
  game_person: Game_PersonEntity;
  @ManyToOne(type => MapDrawingEntity, map_drawing => map_drawing.mapDrawingId)
  map_drawing: MapDrawingEntity;
}