import { Position , Team , Maiden , GameMap , CabOrientation , VictoryType , PlayerNames , PlayerKill , BlessMaiden , ReserveMaiden , UnreserveMaiden , UseMaiden , Glance , CarryFood , GameStart , GameEnd , Victory , Spawn , GetOnSnail , GetOffSnail , SnailEat , SnailEscape , BerryDeposit , BerryKickIn , } from './models/KQStream' ; const teams = { 'gold' : Team . Gold , 'blue' : Team . Blue , } ; const maidens = { 'maidenWings' : Maiden . Warrior , 'maidenSpeed' : Maiden . Speed , } ; const maps = { 'mapDay' : GameMap . Day , 'mapNight' : GameMap . Night , 'mapDusk' : GameMap . Dusk , } ; const orientations = { 'false' : CabOrientation . BlueOnLeft , 'true' : CabOrientation . GoldOnLeft , } ; const victories = { 'military' : VictoryType . Military , 'economic' : VictoryType . Econimic , 'snail' : VictoryType . Snail , } ; const booleans = { 'false' : false , 'true' : true , } ; function position ( x , y ) { return { x : Number ( x ) , y : Number ( y ) } ; } export function playernames ( value ) { return { } ; } export function playerKill ( value ) { const [ x , y , by , killed ] = value ; return { pos : position ( x , y ) , killed : Number ( killed ) , by : Number ( by ) , } ; } export function blessMaiden ( value ) { const [ x , y , team ] = value ; return { pos : position ( x , y ) , team : teams [ team ] , } ; } export function reserveMaiden ( value ) { const [ x , y , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) , } ; } export function unreserveMaiden ( value ) { const [ x , y , _ , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) , } ; } export function useMaiden ( value ) { const [ x , y , type , character ] = value ; return { pos : position ( x , y ) , type : maidens [ type ] , character : Number ( character ) , } ; } export function glance ( value ) { const [ attacker , target ] = value ; return { attacker : Number ( attacker ) , target : Number ( target ) , } ; } export function carryFood ( value ) { const [ character ] = value ; return { character : Number ( character ) , } ; } export function gameStart ( value ) { const [ map , orientation ] = value ; return { map : maps [ map ] , orientation : orientations [ orientation ] , } ; } export function gameEnd ( value ) { const [ map , orientation , duration ] = value ; return { map : maps [ map ] , orientation : orientations [ orientation ] , duration : Number ( duration ) , } ; } export function victory ( value ) { const [ team , type ] = value ; return { team : teams [ team ] , type : victories [ type ] , } ; } export function spawn ( value ) { const [ character , isAI ] = value ; return { character : Number ( character ) , isAI : booleans [ isAI ] , } ; } export function getOnSnail ( value ) { const [ x , y , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) , } ; } export function getOffSnail ( value ) { const [ x , y , _ , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) , } ; } export function snailEat ( value ) { const [ x , y , rider , eaten ] = value ; return { pos : position ( x , y ) , rider : Number ( rider ) , eaten : Number ( eaten ) , } ; } export function snailEscape ( value ) { const [ x , y , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) } ; } export function berryDeposit ( value ) { const [ x , y , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) } ; } export function berryKickIn ( value ) { const [ x , y , character ] = value ; return { pos : position ( x , y ) , character : Number ( character ) } ; }