// sc2k/tile_codes.hpp — names for the tile-code system (XBLD / XTER / XBIT / XZON). // // The save format stores each tile as a handful of byte layers; code all over the engine // tests those bytes against magic ranges. This header gives the ranges and the individual // codes their canonical names, plus the predicates the subsystems share. The constants are // the literals — a static_assert block at the bottom mirrors the old spellings, so a typo // here cannot silently change behaviour. #pragma once #include namespace sc2k { // ── XBLD: the structure code ──────────────────────────────────────────────────────────── // 0 empty; 1..0x6B groundcover and networks; 0x6C.. building-family (occupies the tile); // 0x70.. developed structures (zoned growth, plants, services, rewards, arcologies). namespace xbld { constexpr std::uint8_t kNone = 0x00; constexpr std::uint8_t kRubbleFirst = 0x01; // Rubble 1..4 constexpr std::uint8_t kRubbleLast = 0x04; constexpr std::uint8_t kRadioactive = 0x05; // Radioactive Waste constexpr std::uint8_t kTreeFirst = 0x06; // Tree .. Veritable Jungle (density ramp) constexpr std::uint8_t kTreeLast = 0x0C; constexpr std::uint8_t kSmallPark = 0x0D; // Networks. Each family lays out: two straights, four slopes, four curves, four tees, one cross. constexpr std::uint8_t kPowerFirst = 0x0E; // Power Line: Left-Right constexpr std::uint8_t kPowerTB = 0x0F; // Power Line: Top-Bottom constexpr std::uint8_t kPowerSlopeFirst = 0x10; // Power Line: HighTop-Bottom constexpr std::uint8_t kPowerSlopeHighTopBottom = 0x10; constexpr std::uint8_t kPowerSlopeLeftHighRight = 0x11; constexpr std::uint8_t kPowerSlopeTopHighBottom = 0x12; constexpr std::uint8_t kPowerSlopeHighLeftRight = 0x13; constexpr std::uint8_t kPowerSlopeLast = 0x13; constexpr std::uint8_t kPowerLast = 0x1C; // Power Line: Left-Top-Bottom-Right constexpr std::uint8_t kRoadFirst = 0x1D; // Road: Left-Right constexpr std::uint8_t kRoadTB = 0x1E; // Road: Top-Bottom constexpr std::uint8_t kRoadSlopeFirst = 0x1F; // Road: HighTop-Bottom (slope pieces, one per slope code) constexpr std::uint8_t kRoadSlopeLast = 0x22; constexpr std::uint8_t kRoadLast = 0x2B; // Road: Left-Top-Bottom-Right (the 4-way) constexpr std::uint8_t kRailFirst = 0x2C; // Rail: Left-Right constexpr std::uint8_t kRailXLast = 0x3A; // Rail: Left-Top-Bottom-Right (last true rail shape) constexpr std::uint8_t kRailSlopeExtraFirst = 0x3B; // Rail slope duplicates (the on-slope bank) constexpr std::uint8_t kRailLast = 0x3E; constexpr std::uint8_t kTunnelFirst = 0x3F; // Tunnel mouths: Top/Right/Bottom/Left constexpr std::uint8_t kTunnelLast = 0x42; constexpr std::uint8_t kCrossFirst = 0x43; // power×road, road×rail, rail×power crossings constexpr std::uint8_t kPowerOverRoadTB = 0x43; // Power:Top-Bottom over Road:Left-Right constexpr std::uint8_t kPowerOverRoadLR = 0x44; constexpr std::uint8_t kRoadOverRailTB = 0x45; // Road:Left-Right, Rail:Top-Bottom constexpr std::uint8_t kRoadOverRailLR = 0x46; constexpr std::uint8_t kRailOverPowerTB = 0x47; constexpr std::uint8_t kRailOverPowerLR = 0x48; constexpr std::uint8_t kCrossLast = 0x48; constexpr std::uint8_t kHighwayLR = 0x49; // Highway: Left-Right (ground-level straights) constexpr std::uint8_t kHighwayTB = 0x4A; constexpr std::uint8_t kHighwayCrossFirst = 0x4B; // highway over road/rail/power constexpr std::uint8_t kHighwayOverRoadLR = 0x4B; // Highway:Left-Right, Road:Top-Bottom constexpr std::uint8_t kHighwayOverRoadTB = 0x4C; constexpr std::uint8_t kHighwayOverRailLR = 0x4D; // Highway:Left-Right, Rail:Top-Bottom constexpr std::uint8_t kHighwayOverRailTB = 0x4E; constexpr std::uint8_t kHighwayOverPowerTB = 0x4F; constexpr std::uint8_t kHighwayOverPowerLR = 0x50; constexpr std::uint8_t kHighwayCrossLast = 0x50; constexpr std::uint8_t kBridgeFirst = 0x51; // Suspension Bridge: Start:Bottom constexpr std::uint8_t kSuspensionCenter = 0x53; constexpr std::uint8_t kRaisingBridgeTower = 0x56; constexpr std::uint8_t kBridgePylon = 0x57; constexpr std::uint8_t kBridgeDeck = 0x58; constexpr std::uint8_t kRaisingBridgeDeckUp = 0x59; constexpr std::uint8_t kRailBridgePylon = 0x5A; constexpr std::uint8_t kRailBridgeDeck = 0x5B; constexpr std::uint8_t kRaisedPower = 0x5C; // Raised Power Lines (the power "bridge" deck) constexpr std::uint8_t kBridgeLast = 0x5C; constexpr std::uint8_t kOnrampFirst = 0x5D; // Onramp: highway↔road connectors constexpr std::uint8_t kOnrampLast = 0x60; constexpr std::uint8_t kHighwaySlopeFirst = 0x61; // Highway: HighTop-Bottom (elevated approach pieces) constexpr std::uint8_t kHighwaySlopeLast = 0x64; constexpr std::uint8_t kHighwayCurveFirst = 0x65; // Highway: Bottom-Right .. Top-Right (elevated curves) constexpr std::uint8_t kHighwayCurveLast = 0x68; constexpr std::uint8_t kHighwayCross = 0x69; // Highway: Left-Top-Bottom-Right constexpr std::uint8_t kHighwayBridgePylon = 0x6A; // Highway Reinforced Bridge Pylon constexpr std::uint8_t kHighwayBridgeDeck = 0x6B; // Highway Reinforced Bridge constexpr std::uint8_t kElevatedFirst = 0x61; // everything 0x61..0x6B renders as an elevated deck constexpr std::uint8_t kElevatedLast = 0x6B; // Building-family: from here up the tile is occupied by a structure (mirror bit in XBIT applies). constexpr std::uint8_t kFirstBuilding = 0x6C; constexpr std::uint8_t kSubRailFirst = 0x6C; // Sub-Rail: Top/Right/Bottom/Left (subway↔rail portals) constexpr std::uint8_t kSubRailLast = 0x6F; constexpr std::uint8_t kFirstDeveloped = 0x70; // Lower Class Homes 1 — first zoned-growth structure // Zoned-growth bands (residential / commercial / industrial, small → large). constexpr std::uint8_t kHomesFirst = 0x70; // Lower/Middle/Upper Class Homes constexpr std::uint8_t kHomesLast = 0x7B; constexpr std::uint8_t kConstruction7 = 0x88; // 1×1 construction placeholders constexpr std::uint8_t kConstruction8 = 0x89; constexpr std::uint8_t kAbandoned1 = 0x8A; constexpr std::uint8_t kAbandoned2 = 0x8B; constexpr std::uint8_t kConstruction3 = 0xA6; // 2×2 construction placeholders constexpr std::uint8_t kConstruction6 = 0xA9; constexpr std::uint8_t kAbandoned3 = 0xAA; constexpr std::uint8_t kAbandoned6 = 0xAD; constexpr std::uint8_t kConstruction1 = 0xC2; // 3×3 construction placeholders constexpr std::uint8_t kConstruction2 = 0xC3; constexpr std::uint8_t kAbandoned7 = 0xC4; constexpr std::uint8_t kAbandoned8 = 0xC5; // Power plants (all 0xC6..0xCF; the census/plant code walks this band). constexpr std::uint8_t kPlantFirst = 0xC6; // Hydroelectric 1 constexpr std::uint8_t kHydroPlant1 = 0xC6; constexpr std::uint8_t kHydroPlant2 = 0xC7; constexpr std::uint8_t kWindPlant = 0xC8; constexpr std::uint8_t kGasPlant = 0xC9; constexpr std::uint8_t kOilPlant = 0xCA; constexpr std::uint8_t kNuclearPlant = 0xCB; constexpr std::uint8_t kSolarPlant = 0xCC; constexpr std::uint8_t kMicrowavePlant = 0xCD; constexpr std::uint8_t kFusionPlant = 0xCE; constexpr std::uint8_t kCoalPlant = 0xCF; constexpr std::uint8_t kPlantLast = 0xCF; // Services, rewards and the special-building band. constexpr std::uint8_t kCityHall = 0xD0; constexpr std::uint8_t kHospital = 0xD1; constexpr std::uint8_t kPoliceStation = 0xD2; constexpr std::uint8_t kFireStation = 0xD3; constexpr std::uint8_t kMuseum = 0xD4; constexpr std::uint8_t kBigPark = 0xD5; constexpr std::uint8_t kSchool = 0xD6; constexpr std::uint8_t kStadium = 0xD7; constexpr std::uint8_t kPrison = 0xD8; constexpr std::uint8_t kCollege = 0xD9; constexpr std::uint8_t kZoo = 0xDA; constexpr std::uint8_t kStatue = 0xDB; constexpr std::uint8_t kWaterPump = 0xDC; constexpr std::uint8_t kRunway = 0xDD; constexpr std::uint8_t kRunwayCross = 0xDE; constexpr std::uint8_t kPier = 0xDF; // Seaport Pier constexpr std::uint8_t kCrane = 0xE0; constexpr std::uint8_t kControlTower = 0xE1; // civilian constexpr std::uint8_t kMilControlTower = 0xE2; constexpr std::uint8_t kPortWarehouse = 0xE3; constexpr std::uint8_t kAirportBldg1 = 0xE4; constexpr std::uint8_t kAirportBldg2 = 0xE5; constexpr std::uint8_t kTarmac = 0xE6; constexpr std::uint8_t kFighterJet = 0xE7; constexpr std::uint8_t kMilHangar = 0xE8; constexpr std::uint8_t kSubwayStation = 0xE9; constexpr std::uint8_t kRadar = 0xEA; constexpr std::uint8_t kWaterTower = 0xEB; constexpr std::uint8_t kBusDepot = 0xEC; constexpr std::uint8_t kRailDepot = 0xED; constexpr std::uint8_t kParkingLot = 0xEE; // civilian constexpr std::uint8_t kMilParkingLot = 0xEF; constexpr std::uint8_t kLoadingBay = 0xF0; constexpr std::uint8_t kTopSecret = 0xF1; constexpr std::uint8_t kCargoYard = 0xF2; constexpr std::uint8_t kMayorsHouse = 0xF3; constexpr std::uint8_t kWaterTreatment = 0xF4; constexpr std::uint8_t kLibrary = 0xF5; constexpr std::uint8_t kBigHangar = 0xF6; constexpr std::uint8_t kChurch = 0xF7; constexpr std::uint8_t kMarina = 0xF8; constexpr std::uint8_t kMissileSilo = 0xF9; constexpr std::uint8_t kDesalination = 0xFA; constexpr std::uint8_t kPlymouthArco = 0xFB; constexpr std::uint8_t kForestArco = 0xFC; constexpr std::uint8_t kDarcoArco = 0xFD; constexpr std::uint8_t kLaunchArco = 0xFE; constexpr std::uint8_t kLlamaDome = 0xFF; constexpr std::uint8_t kArcoFirst = 0xFB; constexpr std::uint8_t kArcoLast = 0xFF; // ── predicates ── inline constexpr bool is_rubble(std::uint8_t xb) { return xb >= kRubbleFirst && xb <= kRubbleLast; } inline constexpr bool is_tree(std::uint8_t xb) { return xb >= kTreeFirst && xb <= kTreeLast; } // Native terrain and regional state represent tree cover as the seven non-zero density levels 1..7. // Keep the inverse XBLD conversion shared so simulation policies do not independently reinterpret the art. inline constexpr std::uint8_t tree_density(std::uint8_t xb) { return is_tree(xb) ? static_cast(xb - kTreeFirst + 1) : 0; } inline constexpr bool is_power_line(std::uint8_t xb) { return xb >= kPowerFirst && xb <= kPowerLast; } inline constexpr bool is_road(std::uint8_t xb) { return xb >= kRoadFirst && xb <= kRoadLast; } inline constexpr bool is_rail(std::uint8_t xb) { return xb >= kRailFirst && xb <= kRailLast; } inline constexpr bool is_tunnel(std::uint8_t xb) { return xb >= kTunnelFirst && xb <= kTunnelLast; } // Any tile carrying a rail bed: the rail shapes, every crossing that includes rail // (road/power/highway over rail), and the sub-rail portals. Shared by the commute walker, // the rail commit pass and the growth scan. inline constexpr bool is_rail_bed(std::uint8_t xb) { return is_rail(xb) || (xb >= kRoadOverRailTB && xb <= kRailOverPowerLR) || xb == kHighwayOverRailLR || xb == kHighwayOverRailTB || (xb >= kSubRailFirst && xb <= kSubRailLast); } inline constexpr bool is_highway(std::uint8_t xb) { return (xb >= kHighwayLR && xb <= kHighwayCrossLast) || (xb >= kElevatedFirst && xb <= kElevatedLast); } inline constexpr bool is_bridge(std::uint8_t xb) { return xb >= kBridgeFirst && xb <= kBridgeLast; } inline constexpr bool is_onramp(std::uint8_t xb) { return xb >= kOnrampFirst && xb <= kOnrampLast; } // Elevated highway family: renders as a deck a level above its base tile. inline constexpr bool is_elevated_deck(std::uint8_t xb) { return xb >= kElevatedFirst && xb <= kElevatedLast; } // Any network / groundcover piece (below the building family). inline constexpr bool is_network(std::uint8_t xb) { return xb >= kPowerFirst && xb < kFirstBuilding; } // Building-family: the structure occupies the tile (mirror bit, occlusion, demolition rules). inline constexpr bool is_building(std::uint8_t xb) { return xb >= kFirstBuilding; } // Developed structure (zoned growth and everything above). inline constexpr bool is_developed(std::uint8_t xb) { return xb >= kFirstDeveloped; } inline constexpr bool is_power_plant(std::uint8_t xb) { return xb >= kPlantFirst && xb <= kPlantLast; } inline constexpr bool is_arcology(std::uint8_t xb) { return xb >= kArcoFirst; } // Water-source buildings that feed the pipe network (pump / tower / treatment / desalination). // Kept visible in the x-ray's water view so pipes can be traced back to their sources. inline constexpr bool is_water_source(std::uint8_t xb) { return xb == kWaterPump || xb == kWaterTower || xb == kWaterTreatment || xb == kDesalination; } // Every developed building tile consumes one unit of water except the four buildings that belong to // the water network itself. Keep this next to the code predicates so simulation, queries and rendering // can classify demand without duplicating the special-case list. inline constexpr bool demands_water(std::uint8_t xb) { return is_developed(xb) && !is_water_source(xb); } // Crossings whose sprite ALSO carries a power line — power×road (0x43-0x44), rail×power // (0x47-0x48), highway×power (0x4F-0x50). The road×rail and highway×road/rail crossings do NOT, // so they stay pure Transport. A power crossing belongs to both networks at once. inline constexpr bool is_power_crossing(std::uint8_t xb) { return (xb >= kPowerOverRoadTB && xb <= kPowerOverRoadLR) || (xb >= kRailOverPowerTB && xb <= kRailOverPowerLR) || (xb >= kHighwayOverPowerTB && xb <= kHighwayOverPowerLR); } // Feature-visibility categories for the "View City Layers" toggles. A tile can belong to TWO // at once (a power-over-road crossing is Transport|Power — one sprite, two networks), so this // is a bitmask, not a plain enum. namespace feat { inline constexpr std::uint8_t Transport = 1, Power = 2, Flora = 4, Zoned = 8, Other = 16; } // Map an XBLD to its feature categories. 0 = groundcover (clear/rubble/radioactive): not a // toggleable feature, so it always draws. inline constexpr std::uint8_t features_of(std::uint8_t xb) { if (is_tree(xb)) return feat::Flora; // 0x06-0x0C — trees only if (xb == kSmallPark) return feat::Other; // 0x0D — a placed amenity, not terrain if (is_power_line(xb) || xb == kRaisedPower) return feat::Power; // 0x0E-0x1C + the raised deck 0x5C if (is_power_crossing(xb)) return feat::Transport | feat::Power; // shown if EITHER network is on if (is_road(xb) || is_rail_bed(xb) || is_highway(xb) || is_bridge(xb) || is_onramp(xb) || is_tunnel(xb)) return feat::Transport; // is_rail_bed also covers the 0x6C-0x6F sub-rail portals if (is_developed(xb) && xb < kPlantFirst) return feat::Zoned; // 0x70-0xC5 — R/C/I growth if (is_building(xb)) return feat::Other; // 0xC6+ — civic/plant/park/reward/arcology return 0; } } // namespace xbld // ── XTER: the terrain code ────────────────────────────────────────────────────────────── // 0x00 flat dry land; 0x01..0x0C the slope shapes; 0x0D the raised 1×1 cube. Adding 0x10 // gives the fully submerged version, 0x20 the partially submerged (shore) version; 0x3E is // the waterfall. namespace xter { constexpr std::uint8_t kFlat = 0x00; constexpr std::uint8_t kSlopeFirst = 0x01; constexpr std::uint8_t kSlopeCardFirst = 0x01; // N/E/S/W rises (the four the road slope pieces map to) constexpr std::uint8_t kSlopeCardLast = 0x04; constexpr std::uint8_t kSlopeLast = 0x0C; constexpr std::uint8_t kCube = 0x0D; // the 1×1×1 raised block constexpr std::uint8_t kSubmerged = 0x10; // +0x10: same shape, fully under water constexpr std::uint8_t kSubmergedLast = 0x1D; constexpr std::uint8_t kShore = 0x20; // +0x20: same shape, partially submerged constexpr std::uint8_t kShoreLast = 0x2D; constexpr std::uint8_t kSurfaceWaterFirst = 0x30; // shaped surface-water presentation bank constexpr std::uint8_t kWaterfall = 0x3E; constexpr std::uint8_t kSurfaceWaterAlternateFirst = 0x40; constexpr std::uint8_t kSurfaceWaterLast = 0x45; inline constexpr bool is_slope(std::uint8_t t) { return t >= kSlopeFirst && t <= kSlopeLast; } inline constexpr bool is_cardinal_slope(std::uint8_t t) { return t >= kSlopeCardFirst && t <= kSlopeCardLast; } inline constexpr bool is_cube(std::uint8_t t) { return t == kCube; } // Dry land (flat, slope, or cube — not submerged, not shore, not waterfall). inline constexpr bool is_land(std::uint8_t t) { return t <= kCube; } inline constexpr bool is_submerged(std::uint8_t t) { return t >= kSubmerged && t <= kSubmergedLast; } inline constexpr bool is_shore(std::uint8_t t) { return t >= kShore && t <= kShoreLast; } inline constexpr bool is_surface_water(std::uint8_t t) { return t >= kSurfaceWaterFirst && t <= kSurfaceWaterLast; } inline constexpr bool is_water(std::uint8_t t) { return is_submerged(t) || is_shore(t) || t == kWaterfall; } inline constexpr bool presents_water(std::uint8_t t) { return is_submerged(t) || is_shore(t) || is_surface_water(t) || t == kWaterfall; } // The underlying land shape regardless of water cover. inline constexpr std::uint8_t base_shape(std::uint8_t t) { return t == kWaterfall ? kFlat : std::uint8_t(t & 0x0F); } } // namespace xter // ── XUND: underground network shapes ── namespace xund { constexpr std::uint8_t kNone = 0x00; constexpr std::uint8_t kSubwayFirst = 0x01; constexpr std::uint8_t kSubwayLast = 0x0F; constexpr std::uint8_t kPipeFirst = 0x10; constexpr std::uint8_t kPipeLast = 0x1E; constexpr std::uint8_t kSubwayEWPipeNS = 0x1F; constexpr std::uint8_t kSubwayNSPipeEW = 0x20; constexpr std::uint8_t kSubwaySilo = 0x22; constexpr std::uint8_t kSubRail = 0x23; inline constexpr bool is_pipe(std::uint8_t code) { return (code >= kPipeFirst && code <= kPipeLast) || code == kSubwayEWPipeNS || code == kSubwayNSPipeEW; } inline constexpr bool is_subway(std::uint8_t code) { return (code >= kSubwayFirst && code <= kSubwayLast) || code == kSubwayEWPipeNS || code == kSubwayNSPipeEW || code == kSubwaySilo || code == kSubRail; } } // namespace xund // ── XBIT: the per-tile flag byte ──────────────────────────────────────────────────────── namespace xbit { constexpr std::uint8_t kSaltWater = 0x01; // water on this tile is salt (sea), not fresh constexpr std::uint8_t kMirror = 0x02; // building-family: draw the sprite mirrored; bridges: N-S axis marker constexpr std::uint8_t kWater = 0x04; // surface water covers the tile constexpr std::uint8_t kVisited = 0x08; // transient scratch bit used by the flood passes constexpr std::uint8_t kWatered = 0x10; // reached by the water network this tick constexpr std::uint8_t kPipe = 0x20; // carries water (pipe underneath / water-conductive structure) constexpr std::uint8_t kPowered = 0x40; // reached by the power grid this tick constexpr std::uint8_t kConductive = 0x80; // carries power (line / conductive structure) // The "no power" badge state: conductive but unpowered ((XBIT & 0xC0) == 0x80). constexpr std::uint8_t kPowerMask = kPowered | kConductive; } // namespace xbit // ── XZON: zone nibble + building-corner nibble ────────────────────────────────────────── // Low nibble: the zone type painted on the tile. High nibble: which corner of a multi-tile // building this tile is (all four bits set = the whole footprint / a 1×1). namespace xzon { constexpr std::uint8_t kZoneMask = 0x0F; constexpr std::uint8_t kNone = 0x0; constexpr std::uint8_t kLightRes = 0x1; constexpr std::uint8_t kDenseRes = 0x2; constexpr std::uint8_t kLightCom = 0x3; constexpr std::uint8_t kDenseCom = 0x4; constexpr std::uint8_t kLightInd = 0x5; constexpr std::uint8_t kDenseInd = 0x6; constexpr std::uint8_t kMilitary = 0x7; constexpr std::uint8_t kAirport = 0x8; constexpr std::uint8_t kSeaport = 0x9; constexpr std::uint8_t kCornerMask = 0xF0; constexpr std::uint8_t kCornerTL = 0x10; // at the compass-0 view (growth's kCornerBits rotates these) constexpr std::uint8_t kCornerBL = 0x20; constexpr std::uint8_t kCornerBR = 0x40; constexpr std::uint8_t kCornerTR = 0x80; inline constexpr std::uint8_t zone_of(std::uint8_t xz) { return std::uint8_t(xz & kZoneMask); } inline constexpr std::uint8_t corners_of(std::uint8_t xz) { return std::uint8_t(xz & kCornerMask); } } // namespace xzon // ── XTXT: the text/overlay layer ──────────────────────────────────────────────────────── // 0 empty; 1..50 an on-map sign (index into the label table); 201..240 a Thing anchor // (Things table slot + 200); 251..255 a disaster effect tile drawn by the overlay pass. namespace xtxt { constexpr std::uint8_t kNone = 0x00; constexpr std::uint8_t kSignFirst = 1; constexpr std::uint8_t kSignLast = 50; constexpr std::uint8_t kThingFirst = 201; constexpr std::uint8_t kThingLast = 240; constexpr std::uint8_t kNeighborConnection = 0xFA; constexpr std::uint8_t kEffectFirst = 0xFB; constexpr std::uint8_t kToxicCloud = 0xFB; // also the firestorm/microwave spread tile constexpr std::uint8_t kFlood = 0xFC; constexpr std::uint8_t kRiotSE = 0xFD; // rioter front advancing S/E constexpr std::uint8_t kRiotNW = 0xFE; // rioter front advancing N/W constexpr std::uint8_t kFire = 0xFF; constexpr std::uint8_t kEffectLast = 0xFF; inline constexpr bool is_sign(std::uint8_t v) { return v >= kSignFirst && v <= kSignLast; } inline constexpr bool is_thing(std::uint8_t v) { return v >= kThingFirst && v <= kThingLast; } inline constexpr bool is_effect(std::uint8_t v) { return v >= kEffectFirst; } } // namespace xtxt // ── typo guard: the constants ARE the old literals ────────────────────────────────────── // clang-format off static_assert(xbld::kRubbleFirst == 0x01 && xbld::kRubbleLast == 0x04 && xbld::kRadioactive == 0x05, ""); static_assert(xbld::kTreeFirst == 0x06 && xbld::kTreeLast == 0x0C && xbld::kSmallPark == 0x0D, ""); static_assert(xbld::tree_density(xbld::kTreeFirst) == 1 && xbld::tree_density(xbld::kTreeLast) == 7 && xbld::tree_density(xbld::kNone) == 0, ""); static_assert(xbld::kPowerFirst == 0x0E && xbld::kPowerTB == 0x0F && xbld::kPowerSlopeFirst == 0x10 && xbld::kPowerSlopeLast == 0x13 && xbld::kPowerLast == 0x1C, ""); static_assert(xbld::kRoadFirst == 0x1D && xbld::kRoadSlopeFirst == 0x1F && xbld::kRoadSlopeLast == 0x22 && xbld::kRoadLast == 0x2B, ""); static_assert(xbld::kRailFirst == 0x2C && xbld::kRailXLast == 0x3A && xbld::kRailLast == 0x3E, ""); static_assert(xbld::kTunnelFirst == 0x3F && xbld::kTunnelLast == 0x42, ""); static_assert(xbld::kCrossFirst == 0x43 && xbld::kCrossLast == 0x48, ""); static_assert(xbld::kHighwayLR == 0x49 && xbld::kHighwayTB == 0x4A && xbld::kHighwayCrossFirst == 0x4B && xbld::kHighwayCrossLast == 0x50, ""); static_assert(xbld::kBridgeFirst == 0x51 && xbld::kBridgeDeck == 0x58 && xbld::kRaisedPower == 0x5C && xbld::kBridgeLast == 0x5C, ""); static_assert(xbld::kOnrampFirst == 0x5D && xbld::kOnrampLast == 0x60, ""); static_assert(xbld::kElevatedFirst == 0x61 && xbld::kHighwayCross == 0x69 && xbld::kHighwayBridgeDeck == 0x6B && xbld::kElevatedLast == 0x6B, ""); static_assert(xbld::kFirstBuilding == 0x6C && xbld::kSubRailLast == 0x6F && xbld::kFirstDeveloped == 0x70, ""); static_assert(xbld::kPlantFirst == 0xC6 && xbld::kGasPlant == 0xC9 && xbld::kCoalPlant == 0xCF && xbld::kPlantLast == 0xCF, ""); static_assert(xbld::kPoliceStation == 0xD2 && xbld::kFireStation == 0xD3 && xbld::kBigPark == 0xD5 && xbld::kStatue == 0xDB, ""); static_assert(xbld::kWaterPump == 0xDC && xbld::kRunway == 0xDD && xbld::kPier == 0xDF && xbld::kCrane == 0xE0, ""); static_assert(xbld::kSubwayStation == 0xE9 && xbld::kWaterTower == 0xEB && xbld::kMarina == 0xF8, ""); static_assert(xbld::kPlymouthArco == 0xFB && xbld::kLlamaDome == 0xFF, ""); static_assert(xbld::is_building(0x6C) && !xbld::is_building(0x6B) && xbld::is_developed(0x70) && !xbld::is_developed(0x6F), ""); static_assert(xbld::demands_water(xbld::kHomesFirst) && xbld::demands_water(xbld::kCoalPlant) && !xbld::demands_water(xbld::kWaterPump), ""); static_assert(xbld::is_rail_bed(0x2C) && xbld::is_rail_bed(0x3E) && xbld::is_rail_bed(0x45) && xbld::is_rail_bed(0x48) && xbld::is_rail_bed(77) && xbld::is_rail_bed(78) && xbld::is_rail_bed(0x6C) && xbld::is_rail_bed(0x6F), ""); static_assert(!xbld::is_rail_bed(0x3F) && !xbld::is_rail_bed(0x44) && !xbld::is_rail_bed(0x49) && !xbld::is_rail_bed(0x4C) && !xbld::is_rail_bed(0x4F) && !xbld::is_rail_bed(0x70), ""); static_assert(xbld::is_elevated_deck(0x61) && xbld::is_elevated_deck(0x6B) && !xbld::is_elevated_deck(0x60) && !xbld::is_elevated_deck(0x6C), ""); static_assert(xter::kSlopeFirst == 0x01 && xter::kSlopeCardLast == 0x04 && xter::kSlopeLast == 0x0C && xter::kCube == 0x0D, ""); static_assert(xter::kSubmerged == 0x10 && xter::kShore == 0x20 && xter::kWaterfall == 0x3E, ""); static_assert(xter::kSurfaceWaterFirst == 0x30 && xter::kSurfaceWaterAlternateFirst == 0x40 && xter::kSurfaceWaterLast == 0x45, ""); static_assert(xter::is_land(0x0D) && !xter::is_land(0x10) && xter::is_water(0x3E) && xter::base_shape(0x21) == 0x01, ""); static_assert(xund::kSubwayFirst == 0x01 && xund::kSubwayLast == 0x0F && xund::kPipeFirst == 0x10 && xund::kPipeLast == 0x1E, ""); static_assert(xund::is_pipe(0x1F) && xund::is_pipe(0x20) && xund::is_subway(0x22) && xund::is_subway(0x23), ""); static_assert(xbit::kSaltWater == 0x01 && xbit::kMirror == 0x02 && xbit::kWater == 0x04 && xbit::kVisited == 0x08, ""); static_assert(xbit::kWatered == 0x10 && xbit::kPipe == 0x20 && xbit::kPowered == 0x40 && xbit::kConductive == 0x80, ""); static_assert(xzon::kZoneMask == 0x0F && xzon::kCornerMask == 0xF0 && xzon::kSeaport == 0x9, ""); static_assert(xtxt::kThingFirst == 0xC9 && xtxt::kThingLast == 0xF0 && xtxt::kToxicCloud == 0xFB && xtxt::kFire == 0xFF, ""); static_assert(xtxt::is_effect(0xFB) && !xtxt::is_effect(0xFA) && xtxt::is_thing(201) && !xtxt::is_thing(241), ""); // clang-format on } // namespace sc2k