import flights from '../data/HoPe_all_flights.json';
import {CFlight} from '../classes/CFlight';
import {CSeason} from '../classes/CSeason';
import {groupByMap} from '../global/tools';

const data_raw = flights.data;
export const g_data: CFlight[] = [];
export const g_seasondata: CSeason[] = [];

for (let fl of data_raw) 
{
  g_data.push(new CFlight(fl));
}

const seasondata_raw = groupByMap(g_data, i => i.FKSeason);

for (let [key, value] of seasondata_raw) 
{
  g_seasondata.push(new CSeason(key, value));
}
