2024-02-29 20:08:50 -05:00
|
|
|
import { Arena } from "../field/arena";
|
2023-04-28 15:03:42 -04:00
|
|
|
import { ArenaTag } from "../data/arena-tag";
|
2024-06-13 11:30:47 -04:00
|
|
|
import { Biome } from "../data/enums/biome";
|
2023-04-28 15:03:42 -04:00
|
|
|
import { Weather } from "../data/weather";
|
2024-06-13 10:54:23 -04:00
|
|
|
import { Terrain } from "#app/data/terrain.js";
|
2023-04-28 15:03:42 -04:00
|
|
|
|
|
|
|
export default class ArenaData {
|
|
|
|
public biome: Biome;
|
|
|
|
public weather: Weather;
|
2024-06-13 10:54:23 -04:00
|
|
|
public terrain: Terrain;
|
2023-04-28 15:03:42 -04:00
|
|
|
public tags: ArenaTag[];
|
|
|
|
|
|
|
|
constructor(source: Arena | any) {
|
|
|
|
const sourceArena = source instanceof Arena ? source as Arena : null;
|
|
|
|
this.biome = sourceArena ? sourceArena.biomeType : source.biome;
|
|
|
|
this.weather = sourceArena ? sourceArena.weather : source.weather ? new Weather(source.weather.weatherType, source.weather.turnsLeft) : undefined;
|
2024-06-13 10:54:23 -04:00
|
|
|
this.terrain = sourceArena ? sourceArena.terrain : source.terrain ? new Terrain(source.terrain.terrainType, source.terrain.turnsLeft) : undefined;
|
2023-04-28 15:03:42 -04:00
|
|
|
this.tags = sourceArena ? sourceArena.tags : [];
|
|
|
|
}
|
2024-05-23 17:03:10 +02:00
|
|
|
}
|