From f09fd839b790c90e781a6735c065f16b7a07e8f5 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 1 Mar 2020 21:34:20 -0500 Subject: [PATCH] consolidate bc files --- .../backwardsCompatibility.js | 62 ++++++++++++++++++ src/data/backwardsCompatibility/generalBC.js | 63 ------------------- 2 files changed, 62 insertions(+), 63 deletions(-) delete mode 100644 src/data/backwardsCompatibility/generalBC.js diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index b9b6e89b88c..1dd0a392e1d 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -4030,3 +4030,65 @@ App.Update.cleanUp = function() { return; }; +App.Update.sectorsToBuilding = function() { + V.building = new App.Arcology.Building([]); + const B = V.building; + const S = V.sectors; + + B.sections.push(new App.Arcology.Section("penthouse", [[new App.Arcology.Cell.Penthouse()]])); + if (V.arcologyUpgrade.spire === 1) { + B.sections.push(new App.Arcology.Section("spire", [[ + sectorToApartment(S[1]), sectorToApartment(S[2])], [ + sectorToApartment(S[3]), sectorToApartment(S[4])]])); + } + B.sections.push(new App.Arcology.Section("apartments", + [ + [sectorToApartment(S[8]), sectorToApartment(S[9]), sectorToApartment(S[10]), sectorToApartment(S[11])], + [sectorToApartment(S[12]), sectorToApartment(S[13]), sectorToApartment(S[14]), sectorToApartment(S[15])], + [sectorToApartment(S[16]), sectorToApartment(S[17]), sectorToApartment(S[18]), sectorToApartment(S[19])], + ])); + + function sectorToApartment(sector) { + const a = new App.Arcology.Cell.Apartment(sector.ownership); + if (sector.type === "LuxuryApartments") { + a.type = 1; + } else if (sector.type === "DenseApartments") { + a.type = 3; + } + return a; + } + + B.sections.push(new App.Arcology.Section("shops", [[sectorToShop(S[5]), sectorToShop(S[6]), sectorToShop(S[7])]])); + + function sectorToShop(sector) { + return new App.Arcology.Cell.Shop(sector.ownership, sector.type); + } + + B.sections.push(new App.Arcology.Section("markets", + [[sectorToMarket(S[20]), sectorToMarket(S[21]), sectorToMarket(S[22]), sectorToMarket(S[23]), sectorToMarket(S[24])]])); + + function sectorToMarket(sector) { + const m = new App.Arcology.Cell.Market(sector.ownership); + if (sector.type === "transportHub") { + m.type = "Transport Hub"; + } else if (sector.type === "CorporateMarket") { + m.type = "Corporate Market"; + } else { + m.type = sector.type; + } + return m; + } + + B.sections.push(new App.Arcology.Section("manufacturing", + [[sectorToManu(S[25]), sectorToManu(S[26]), sectorToManu(S[27]), sectorToManu(S[28]), sectorToManu(S[29])]])); + + function sectorToManu(sector) { + const m = new App.Arcology.Cell.Manufacturing(sector.ownership); + if (sector.type === "weapManu") { + m.type = "Weapon Manufacturing"; + } else { + m.type = sector.type; + } + return m; + } +}; diff --git a/src/data/backwardsCompatibility/generalBC.js b/src/data/backwardsCompatibility/generalBC.js deleted file mode 100644 index 654ef4d55de..00000000000 --- a/src/data/backwardsCompatibility/generalBC.js +++ /dev/null @@ -1,63 +0,0 @@ -App.Update.sectorsToBuilding = function() { - V.building = new App.Arcology.Building([]); - const B = V.building; - const S = V.sectors; - - B.sections.push(new App.Arcology.Section("penthouse", [[new App.Arcology.Cell.Penthouse()]])); - if (V.arcologyUpgrade.spire === 1) { - B.sections.push(new App.Arcology.Section("spire", [[ - sectorToApartment(S[1]), sectorToApartment(S[2])], [ - sectorToApartment(S[3]), sectorToApartment(S[4])]])); - } - B.sections.push(new App.Arcology.Section("apartments", - [ - [sectorToApartment(S[8]), sectorToApartment(S[9]), sectorToApartment(S[10]), sectorToApartment(S[11])], - [sectorToApartment(S[12]), sectorToApartment(S[13]), sectorToApartment(S[14]), sectorToApartment(S[15])], - [sectorToApartment(S[16]), sectorToApartment(S[17]), sectorToApartment(S[18]), sectorToApartment(S[19])], - ])); - - function sectorToApartment(sector) { - const a = new App.Arcology.Cell.Apartment(sector.ownership); - if (sector.type === "LuxuryApartments") { - a.type = 1; - } else if (sector.type === "DenseApartments") { - a.type = 3; - } - return a; - } - - B.sections.push(new App.Arcology.Section("shops", [[sectorToShop(S[5]), sectorToShop(S[6]), sectorToShop(S[7])]])); - - function sectorToShop(sector) { - return new App.Arcology.Cell.Shop(sector.ownership, sector.type); - } - - B.sections.push(new App.Arcology.Section("markets", - [[sectorToMarket(S[20]), sectorToMarket(S[21]), sectorToMarket(S[22]), sectorToMarket(S[23]), sectorToMarket(S[24])]])); - - function sectorToMarket(sector) { - const m = new App.Arcology.Cell.Market(sector.ownership); - if (sector.type === "transportHub") { - m.type = "Transport Hub"; - } else if (sector.type === "CorporateMarket") { - m.type = "Corporate Market"; - } else { - m.type = sector.type; - } - return m; - } - - B.sections.push(new App.Arcology.Section("manufacturing", - [[sectorToManu(S[25]), sectorToManu(S[26]), sectorToManu(S[27]), sectorToManu(S[28]), sectorToManu(S[29])]])); - - function sectorToManu(sector) { - const m = new App.Arcology.Cell.Manufacturing(sector.ownership); - if (sector.type === "weapManu") { - m.type = "Weapon Manufacturing"; - } else { - m.type = sector.type; - } - return m; - } - -}; -- GitLab