|
|
@ -20,14 +20,14 @@ export class CardService { |
|
|
if(set.isPromo) |
|
|
if(set.isPromo) |
|
|
{ |
|
|
{ |
|
|
info = this.convertPromoCard(set, item, hypercount); |
|
|
info = this.convertPromoCard(set, item, hypercount); |
|
|
if(info.hyperspaceSetNumber != -1) |
|
|
|
|
|
{ |
|
|
|
|
|
hypercount = hypercount + 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
info = this.convertStandardCard(set, item, hypercount); |
|
|
info = this.convertStandardCard(set, item, hypercount); |
|
|
|
|
|
if(info.hyperspaceSetNumber != -1) |
|
|
|
|
|
{ |
|
|
|
|
|
hypercount = hypercount + 1; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cards.push(info); |
|
|
cards.push(info); |
|
|
@ -45,19 +45,25 @@ export class CardService { |
|
|
{ |
|
|
{ |
|
|
info.hyperspaceSetNumber = set.total + hypercount + 1; |
|
|
info.hyperspaceSetNumber = set.total + hypercount + 1; |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
info.hyperspaceSetNumber = -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// The types are included in the last cell.
|
|
|
// The types are included in the last cell.
|
|
|
let typesString = data[data.length-1] as string; |
|
|
let typesString = data[data.length-1] as string; |
|
|
let types = typesString.split(/\s*,\s*/); |
|
|
let types = Array.from(typesString.split(/\s*,\s*/)); |
|
|
|
|
|
|
|
|
info.setCode = set.code; |
|
|
info.setCode = set.code; |
|
|
info.isLeader = "Leader" in types; |
|
|
info.isLeader = types.includes("Leader"); |
|
|
info.isBase = "Base" in types; |
|
|
info.isBase = types.includes("Base"); |
|
|
info.standardQuantity = data[1] ? parseInt(data[1].toString()) : 0; |
|
|
info.standardQuantity = data[1] ? parseInt(data[1].toString()) : 0; |
|
|
info.foilQuantity = data[2] ? parseInt(data[2].toString()) as number : 0; |
|
|
info.foilQuantity = data[2] ? parseInt(data[2].toString()) as number : 0; |
|
|
info.hyperspaceQuantity = data[3] ? parseInt(data[3].toString()) as number : 0; |
|
|
info.hyperspaceQuantity = data[3] ? parseInt(data[3].toString()) as number : 0; |
|
|
info.hyperspaceFoilQuantity = data[4] ? parseInt(data[4].toString()) as number : 0; |
|
|
info.hyperspaceFoilQuantity = data[4] ? parseInt(data[4].toString()) as number : 0; |
|
|
|
|
|
|
|
|
|
|
|
info.name = data[10] as string; |
|
|
|
|
|
|
|
|
return info; |
|
|
return info; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -66,6 +72,17 @@ export class CardService { |
|
|
|
|
|
|
|
|
info.setNumber = parseInt(data[0].toString()); |
|
|
info.setNumber = parseInt(data[0].toString()); |
|
|
|
|
|
|
|
|
|
|
|
// The types are included in the last cell.
|
|
|
|
|
|
let typesString = data[data.length-1] as string; |
|
|
|
|
|
let types = Array.from(typesString.split(/\s*,\s*/)); |
|
|
|
|
|
|
|
|
|
|
|
info.setCode = set.code; |
|
|
|
|
|
info.isLeader = types.includes("Leader"); |
|
|
|
|
|
info.isBase = types.includes("Base"); |
|
|
|
|
|
info.standardQuantity = data[1] ? parseInt(data[1].toString()) : 0; |
|
|
|
|
|
|
|
|
|
|
|
info.name = data[10] as string; |
|
|
|
|
|
|
|
|
return info; |
|
|
return info; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |