export interface Units { megacredits : number ; steel : number ; titanium : number ; plants : number ; energy : number ; heat : number ; } export namespace Units { export const EMPTY = { get megacredits ( ) { return 0 ; } , get steel ( ) { return 0 ; } , get titanium ( ) { return 0 ; } , get plants ( ) { return 0 ; } , get energy ( ) { return 0 ; } , get heat ( ) { return 0 ; } , } ; export function of ( partialUnits ) { return { megacredits : partialUnits . megacredits === undefined ? 0 : partialUnits . megacredits , steel : partialUnits . steel === undefined ? 0 : partialUnits . steel , titanium : partialUnits . titanium === undefined ? 0 : partialUnits . titanium , plants : partialUnits . plants === undefined ? 0 : partialUnits . plants , energy : partialUnits . energy === undefined ? 0 : partialUnits . energy , heat : partialUnits . heat === undefined ? 0 : partialUnits . heat , } ; } export function negative ( units ) { return { megacredits : - units . megacredits , steel : - units . steel , titanium : - units . titanium , plants : - units . plants , energy : - units . energy , heat : - units . heat , } ; } }