E.W.O. Next / All files / src/engine/models Maps.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72                                        11x 11x 11x                                                                                                  
/**
 * @module Engine.Models
 * Map, Plan and Coord
 */
 
import { Character } from '@models';
import { CharacterFrontend, CharacterLimitedFrontend } from './Character/Character';
 
export interface Plan {
  id: string;
  name: string;
  rawMapName: string;
}
 
export interface Coord {
  x: number;
  y: number;
  character: Character;
}
 
export enum POVState {
  Fog,
  Block,
}
 
export interface CoordDatabase {
  x: number;
  y: number;
  mat: number;
}
 
export interface CoordFrontend {
  x: number;
  y: number;
  type: 'cha' | 'pov' | 'env' | 'lab' | 'met';
}
 
export interface CoordCharacterFrontend extends CoordFrontend {
  character: CharacterFrontend | CharacterLimitedFrontend;
}
 
export interface CoordPovFrontend extends CoordFrontend {
  state: POVState;
}
 
export interface CoordEnvironmentFrontend extends CoordFrontend {
  tile: number;
  layer: number;
}
 
export interface ViewFrontend {
  characters: CoordCharacterFrontend[];
  pov: CoordPovFrontend[];
  environment: CoordEnvironmentFrontend[];
  tileImage: string;
}
 
/**
 * RAW map definition
 */
export interface RawMap {
  block: number[][];
  meta: MapMeta[][];
  tiles: {[key: number]: number}[][];
  image: string;
}
 
export interface MapMeta {
  cost?: number;
  block?: boolean;
}