├── project └── build.properties ├── lua ├── adv_nam_dll.lua.TGI └── adv_nam_dll.lua ├── Controller ├── INI │ └── NetworkINI.ini.TGI ├── Bridge Controller │ ├── 00001003.rul.TGI │ ├── 00001000.rul.TGI │ ├── 00001001.rul.TGI │ ├── 00001006.rul.TGI │ ├── 00001008.rul.TGI │ ├── 00001009.rul.TGI │ ├── 0000100a.rul.TGI │ ├── 0000100b.rul.TGI │ ├── 0000100c.rul.TGI │ └── RULConfig.txt ├── INRULs │ ├── PipeBasic │ │ └── RUL03_Pipe_Basic.rul.TGI │ ├── RailBasic │ │ ├── RUL05_Rail_Basic.rul.TGI │ │ └── RUL05_Rail_Basic-RRW.rul.TGI │ ├── RoadBasic │ │ └── RUL07_Road_Basic.rul.TGI │ ├── AvenueBasic │ │ ├── RUL0D_Avenue_Basic.rul.TGI │ │ └── RUL0D_Avenue_Basic_Lite.rul.TGI │ ├── DirtroadBasic │ │ └── RUL13_RHW_Basic.rul.TGI │ ├── HighwayBasic │ │ └── RUL01_EMHWY_Basic.rul.TGI │ ├── OnewayroadBasic │ │ ├── RUL11_OWR_Basic.rul.TGI │ │ └── RUL11_OWR_Basic_memoOWRArrowReduction.rul.TGI │ ├── PipeAdvanced │ │ └── RUL04_Pipe_Advanced.rul.TGI │ ├── RailAdvanced │ │ ├── RUL06_Rail_Advanced.rul.TGI │ │ └── RUL06_Rail_Advanced-RRW.rul.TGI │ ├── RoadAdvanced │ │ └── RUL08_Road_Advanced.rul.TGI │ ├── SubwayBasic │ │ └── RUL0B_Subway_Basic.rul.TGI │ ├── DirtroadAdvanced │ │ └── RUL14_RHW_Advanced.rul.TGI │ ├── GroundhighwayBasic │ │ └── RUL17_GHWY_Basic.rul.TGI │ ├── HighwayAdvanced │ │ └── RUL02_EMHWY_Advanced.rul.TGI │ ├── LightrailBasic │ │ ├── RUL0F_LightRail_Basic.rul.TGI │ │ └── RUL0F_LightRail_Basic.rul │ ├── OnewayroadAdvanced │ │ └── RUL12_OWR_Advanced.rul.TGI │ ├── SubwayAdvanced │ │ └── RUL0C_Subway_Advanced.rul.TGI │ ├── GroundhighwayAdvanced │ │ └── RUL18_GHWY_Advanced.rul.TGI │ ├── LightrailAdvanced │ │ └── RUL10_LightRail_Advanced.rul.TGI │ ├── MonorailAdvanced │ │ └── RUL16_Monorail_Advanced.rul.TGI │ ├── AvenueAdvanced │ │ ├── RUL0E_Avenue_Advanced_Header.rul │ │ ├── README_RUL0E.txt │ │ └── RUL0E_Avenue_Advanced_Lite.rul │ ├── StreetBasic │ │ └── RUL09_Street_Basic_Header.rul │ ├── StreetAdvanced │ │ └── RUL0A_Street_Advanced_Header.rul │ └── MonorailBasic │ │ └── RUL15_Monorail_Basic.rul ├── RUL0 │ ├── 1000_2000_3000_MaxisContent │ │ └── warning.rtf │ ├── 4000_RAM │ │ └── 4100_L2STR.txt │ ├── F000_Special │ │ ├── FF00_DummyButton.txt │ │ └── F210_AdvancedBridges.txt │ ├── 7000_Road_NWM │ │ └── 7C00_SingleTileRoundabouts.txt │ └── B000_Lightrail │ │ └── BD00_GLRExtension.txt ├── RUL2 │ ├── 01_Maxis_Misc │ │ ├── Sec1d_OWR_Misc.txt │ │ ├── Sec1b_OWR_ARP.txt │ │ └── Sec1f_Avenue_Misc.txt │ ├── 07_RHW │ │ ├── Sec7b_BaseNetwork │ │ │ ├── Ramp_2_R3_Branch_LHD.txt │ │ │ ├── Ramp_2_R3_Branch_RHD.txt │ │ │ ├── 0F_Emergency_Lane.txt │ │ │ ├── T00A_Street_ThruT_OxO.txt │ │ │ ├── T00B_Street_ThruT_OxO.txt │ │ │ ├── F3_MHW_Ortho_Transition.txt │ │ │ ├── T03B_Avenue_ThruT_OxO.txt │ │ │ └── T09B_ARD-3_ThruT_OxO.txt │ │ ├── Sec7c_RHWxRHW │ │ │ ├── Supplement_WiderRHW_DxO.txt │ │ │ └── Supplement_L1L2_RHW-2xL0_RHW-2_OxO.txt │ │ ├── Sec7i_FLEXRamp │ │ │ ├── Sec7ic_FLEXRamp_QuickChange_LHD.txt │ │ │ └── Sec7ic_FLEXRamp_QuickChange_RHD.txt │ │ └── Sec7h_Flex_Transition │ │ │ ├── Sec7h6_FlexHT_MRC_Adjacencies_Diag.txt │ │ │ └── Sec7h3_FlexHT-DOST-Cross.txt │ ├── 00_Head │ │ └── Sec0_Head.txt │ ├── 06_Road_Viaducts │ │ └── Sec6c_additions.txt │ ├── 08_NWM │ │ ├── Sec8b_NWM_STR.txt │ │ ├── ST_Shared_Tile_Fixes.txt │ │ ├── BR_Bridge_Initialization.txt │ │ ├── 43b_Avenue_OxO_T_NWM.txt │ │ ├── 3Ad_ARD-3_OxO_+_NWM.txt │ │ ├── Small_90_ARD-3_Add_NWM.txt │ │ ├── 0B_Orth-Diag_Bottom_NWM.txt │ │ ├── TLA-9-AVE-8-Temp.txt │ │ ├── Sec8h_NWM_MRC_Adjacency.txt │ │ └── REW_Splitter_Wyes.txt │ ├── 11_Rail │ │ ├── Sec11b_RAM-RRW_conversioncode.txt │ │ ├── Sec11q_RRW_STR_Retexture.txt │ │ └── Sec11k_RRW_ParallelNetworkSupport.txt │ ├── 03_Turn_Lanes │ │ ├── Sec3f_FTL_Adjacent_ERRW.txt │ │ ├── Sec3g_Rural FTL.txt │ │ └── Sec3h_CFI.txt │ ├── 04_Roundabouts │ │ └── Sec4b_Road_Roundabouts.txt │ ├── 13_DualNetworking │ │ └── Sec13g_RailDualNetworking_Asymmetrical.txt │ └── 02_Diagonal_Streets │ │ └── Sec2a_Diagonal_Streets_Intersections.txt └── RUL1 │ ├── 06_Lightrail │ ├── 07_Lightrail_Monorail.txt │ └── 10_Lightrail_GroundHighway.txt │ ├── 03_Highway │ ├── 06_Highway_Lightrail.txt │ └── 07_Highway_Monorail.txt │ ├── 00_head.txt │ ├── 02_Rail │ ├── 10_Rail_Subway.txt │ └── 11_Rail_GroundHighway.txt │ ├── 08_OneWayRoad │ ├── 11_OneWayRoad_Subway.txt │ └── 10_OneWayRoad_GroundHighway.txt │ ├── 05_Avenue │ └── 10_Avenue_GroundHighway.txt │ ├── 07_Monorail │ └── 10_Monorail_GroundHighway.txt │ └── 99_AllowedOverrides.txt ├── Lite Controller ├── INI │ └── NetworkINI.ini.TGI ├── RUL0 │ └── 1000_2000_3000_MaxisContent │ │ └── warning.rtf ├── RUL2 │ ├── Sec1d_OWR_Misc.txt │ ├── Sec1e_Rd_Misc.txt │ └── Sec0_Head.txt └── RUL1 │ ├── 06_Lightrail │ ├── 07_Lightrail_Monorail.txt │ └── 10_Lightrail_GroundHighway.txt │ ├── 03_Highway │ ├── 06_Highway_Lightrail.txt │ └── 07_Highway_Monorail.txt │ ├── 00_head.txt │ ├── 02_Rail │ ├── 10_Rail_Subway.txt │ └── 11_Rail_GroundHighway.txt │ ├── 08_OneWayRoad │ ├── 11_OneWayRoad_Subway.txt │ └── 10_OneWayRoad_GroundHighway.txt │ ├── 05_Avenue │ └── 10_Avenue_GroundHighway.txt │ ├── 99_AllowedOverrides.txt │ └── 07_Monorail │ └── 10_Monorail_GroundHighway.txt ├── NAM Installer Script_Monolith.nsi ├── src ├── main │ ├── resources │ │ ├── rhwResources.dat │ │ ├── flexFlyResources.dat │ │ └── flexfly-T21-templates.dat │ └── scala │ │ ├── module │ │ ├── package.scala │ │ ├── flexfly │ │ │ └── CompileFlexFlyCode.scala │ │ ├── CompileRealRailwayCode.scala │ │ ├── GlrRuleGenerator.scala │ │ ├── NwmRuleGenerator.scala │ │ ├── CompileAllMetarules.scala │ │ ├── RhwRuleGenerator.scala │ │ ├── Main.scala │ │ ├── onslope.scala │ │ └── SanityChecker.scala │ │ ├── pathing │ │ └── nwmpaths │ │ │ └── Main.scala │ │ └── scripts │ │ └── MissingInstanceChecker.scala ├── test │ └── scala │ │ ├── module │ │ ├── flexfly │ │ │ ├── FlexFlyResolverSpec.scala │ │ │ └── CompileFlexFlyRul0And1Spec.scala │ │ ├── ReverseResolverSpec.scala │ │ ├── ResolverBuilderSpec.scala │ │ └── RhwResolverSpec.scala │ │ ├── localization │ │ └── GenerateLocalesSpec.scala │ │ ├── pathing │ │ └── nwmpaths │ │ │ └── PathCreatorSpec.scala │ │ ├── scripts │ │ ├── RedundantAdjacenciesCheckerSpec.scala │ │ └── SegmentOrientationCheckerSpec.scala │ │ └── meta │ │ └── RuleTransducerSpec.scala └── scripts │ ├── compile-release-bridge-controller.sh │ ├── syntax-check-rul2.sh │ ├── remove-rhw-adjacencies.py │ ├── compile-release-inruls.sh │ ├── remove-nwm-adjacencies.py │ └── compile-release-controllers.sh ├── ltext ├── synchronize-translations.sh ├── puzzlepieces-avenue.pot ├── sv │ └── puzzlepieces-avenue.po ├── pt │ └── puzzlepieces-avenue.po ├── de │ └── puzzlepieces-avenue.po ├── ko │ └── puzzlepieces-avenue.po ├── fr │ └── puzzlepieces-avenue.po ├── it │ └── puzzlepieces-avenue.po └── es │ └── puzzlepieces-avenue.po ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── scala.yml └── .gitignore /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.10.7 2 | -------------------------------------------------------------------------------- /lua/adv_nam_dll.lua.TGI: -------------------------------------------------------------------------------- 1 | CA63E2A3 2 | 4A5E8EF6 3 | 2A504B00 4 | -------------------------------------------------------------------------------- /Controller/INI/NetworkINI.ini.TGI: -------------------------------------------------------------------------------- 1 | 00000000 2 | 8A5971C5 3 | 8A5993B9 4 | -------------------------------------------------------------------------------- /Lite Controller/INI/NetworkINI.ini.TGI: -------------------------------------------------------------------------------- 1 | 00000000 2 | 8A5971C5 3 | 8A5993B9 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001003.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001003 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001000.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001000 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001001.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001001 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001006.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001006 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001008.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001008 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/00001009.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00001009 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/0000100a.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000100A 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/0000100b.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000100B 4 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/0000100c.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000100C 4 | -------------------------------------------------------------------------------- /Controller/INRULs/PipeBasic/RUL03_Pipe_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000003 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RailBasic/RUL05_Rail_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000005 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RoadBasic/RUL07_Road_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000007 4 | -------------------------------------------------------------------------------- /Controller/INRULs/AvenueBasic/RUL0D_Avenue_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000000D 4 | -------------------------------------------------------------------------------- /Controller/INRULs/DirtroadBasic/RUL13_RHW_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000013 4 | -------------------------------------------------------------------------------- /Controller/INRULs/HighwayBasic/RUL01_EMHWY_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000001 4 | -------------------------------------------------------------------------------- /Controller/INRULs/OnewayroadBasic/RUL11_OWR_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000011 4 | -------------------------------------------------------------------------------- /Controller/INRULs/PipeAdvanced/RUL04_Pipe_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000004 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RailAdvanced/RUL06_Rail_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000006 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RailBasic/RUL05_Rail_Basic-RRW.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000005 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RoadAdvanced/RUL08_Road_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000008 4 | -------------------------------------------------------------------------------- /Controller/INRULs/SubwayBasic/RUL0B_Subway_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000000B 4 | -------------------------------------------------------------------------------- /Controller/INRULs/AvenueBasic/RUL0D_Avenue_Basic_Lite.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000000D 4 | -------------------------------------------------------------------------------- /Controller/INRULs/DirtroadAdvanced/RUL14_RHW_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000014 4 | -------------------------------------------------------------------------------- /Controller/INRULs/GroundhighwayBasic/RUL17_GHWY_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000017 4 | -------------------------------------------------------------------------------- /Controller/INRULs/HighwayAdvanced/RUL02_EMHWY_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000002 4 | -------------------------------------------------------------------------------- /Controller/INRULs/LightrailBasic/RUL0F_LightRail_Basic.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000000F 4 | -------------------------------------------------------------------------------- /Controller/INRULs/OnewayroadAdvanced/RUL12_OWR_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000012 4 | -------------------------------------------------------------------------------- /Controller/INRULs/RailAdvanced/RUL06_Rail_Advanced-RRW.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000006 4 | -------------------------------------------------------------------------------- /Controller/INRULs/SubwayAdvanced/RUL0C_Subway_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 0000000C 4 | -------------------------------------------------------------------------------- /Controller/INRULs/GroundhighwayAdvanced/RUL18_GHWY_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000018 4 | -------------------------------------------------------------------------------- /Controller/INRULs/LightrailAdvanced/RUL10_LightRail_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000010 4 | -------------------------------------------------------------------------------- /Controller/INRULs/MonorailAdvanced/RUL16_Monorail_Advanced.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000016 4 | -------------------------------------------------------------------------------- /Controller/INRULs/OnewayroadBasic/RUL11_OWR_Basic_memoOWRArrowReduction.rul.TGI: -------------------------------------------------------------------------------- 1 | 0A5BCF4B 2 | AA5BCF57 3 | 00000011 4 | -------------------------------------------------------------------------------- /NAM Installer Script_Monolith.nsi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAMTeam/Network-Addon-Mod/HEAD/NAM Installer Script_Monolith.nsi -------------------------------------------------------------------------------- /src/main/resources/rhwResources.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAMTeam/Network-Addon-Mod/HEAD/src/main/resources/rhwResources.dat -------------------------------------------------------------------------------- /src/main/resources/flexFlyResources.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAMTeam/Network-Addon-Mod/HEAD/src/main/resources/flexFlyResources.dat -------------------------------------------------------------------------------- /src/main/resources/flexfly-T21-templates.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAMTeam/Network-Addon-Mod/HEAD/src/main/resources/flexfly-T21-templates.dat -------------------------------------------------------------------------------- /Controller/RUL0/1000_2000_3000_MaxisContent/warning.rtf: -------------------------------------------------------------------------------- 1 | Be careful when using HIDs in these ranges, as the Maxis content HIDs are not ordered incrementally. -------------------------------------------------------------------------------- /Lite Controller/RUL0/1000_2000_3000_MaxisContent/warning.rtf: -------------------------------------------------------------------------------- 1 | Be careful when using HIDs in these ranges, as the Maxis content HIDs are not ordered incrementally. -------------------------------------------------------------------------------- /Lite Controller/RUL2/Sec1d_OWR_Misc.txt: -------------------------------------------------------------------------------- 1 | ; smooth transition to diagonal next to diag OWR into Rd T int 2 | 0x09000A00,3,0,0x5F973300,0,0=0x09000C00,3,0,0x5F973300,0,0 3 | 0x09000A00,0,0,0x5F973300,2,1=0x09000C00,1,1,0x5F973300,2,1 -------------------------------------------------------------------------------- /Controller/RUL2/01_Maxis_Misc/Sec1d_OWR_Misc.txt: -------------------------------------------------------------------------------- 1 | ; smooth transition to diagonal next to diag OWR into Rd T int 2 | 0x09000A00,3,0,0x5F973300,0,0=0x09000C00,3,0,0x5F973300,0,0 3 | 0x09000A00,0,0,0x5F973300,2,1=0x09000C00,1,1,0x5F973300,2,1 -------------------------------------------------------------------------------- /src/main/scala/module/package.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam 2 | 3 | /** Contains (sample) code for generating RUL2 code for specific RUL2 projects 4 | * (to be extended). 5 | */ 6 | package object module { 7 | val LOGGER = java.util.logging.Logger.getLogger("networkaddonmod") 8 | } 9 | -------------------------------------------------------------------------------- /Controller/RUL1/06_Lightrail/07_Lightrail_Monorail.txt: -------------------------------------------------------------------------------- 1 | [LightRailMonoRailIntersectionSolutions] 2 | ;;Added 061405 ~ Tropod 3 | ;orthogonal, orthogonal 4 | ;TYPE1=0x02000200,0x00020002,0x12345678,0,0 5 | ;TYPE1=0x00020002,0x02000200,0x12345678,1,0 6 | ; 7 | ; 8 | ; 9 | ; 10 | ; 11 | ; 12 | ; 13 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/06_Lightrail/07_Lightrail_Monorail.txt: -------------------------------------------------------------------------------- 1 | [LightRailMonoRailIntersectionSolutions] 2 | ;;Added 061405 ~ Tropod 3 | ;orthogonal, orthogonal 4 | ;TYPE1=0x02000200,0x00020002,0x12345678,0,0 5 | ;TYPE1=0x00020002,0x02000200,0x12345678,1,0 6 | ; 7 | ; 8 | ; 9 | ; 10 | ; 11 | ; 12 | ; 13 | -------------------------------------------------------------------------------- /Lite Controller/RUL2/Sec1e_Rd_Misc.txt: -------------------------------------------------------------------------------- 1 | ; smooth transition to ortho road / diag owr transition 5F045C00 2 | 0x5f045c00,3,0,0x00004b00,1,0=0x5f045c00,3,0,0x00004d00,3,1 3 | 0x5f045c00,3,0,0x00004b00,3,0=0x5f045c00,3,0,0x00004d00,3,1 4 | 0x5f045c00,1,1,0x00004b00,1,0=0x5f045c00,1,1,0x00004d00,1,0 5 | 0x5f045c00,1,1,0x00004b00,3,0=0x5f045c00,1,1,0x00004d00,1,0 6 | -------------------------------------------------------------------------------- /Controller/RUL1/03_Highway/06_Highway_Lightrail.txt: -------------------------------------------------------------------------------- 1 | [HighwayLightRailIntersectionSolutions] 2 | ; 3 | ;DDRHW Specials (added by Tarkus, 06072012) 4 | ;OxO (16) 5 | TYPE1=0x02000000,0x00020002,0x57531600,1,0 6 | TYPE2=0x00020000,0x02000200,0x57531600,2,0 7 | TYPE3=0x00000200,0x00020002,0x57531600,3,0 8 | TYPE4=0x00000002,0x02000200,0x57531600,0,0 9 | 10 | -------------------------------------------------------------------------------- /Controller/RUL1/03_Highway/07_Highway_Monorail.txt: -------------------------------------------------------------------------------- 1 | [HighwayMonoRailIntersectionSolutions] 2 | ; 3 | ;DDRHW Specials (added by Tarkus, 06072012) 4 | ;OxO (17) 5 | TYPE1=0x02000000,0x00020002,0x57531700,1,0 6 | TYPE2=0x00020000,0x02000200,0x57531700,2,0 7 | TYPE3=0x00000200,0x00020002,0x57531700,3,0 8 | TYPE4=0x00000002,0x02000200,0x57531700,0,0 9 | 10 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/03_Highway/06_Highway_Lightrail.txt: -------------------------------------------------------------------------------- 1 | [HighwayLightRailIntersectionSolutions] 2 | ; 3 | ;DDRHW Specials (added by Tarkus, 06072012) 4 | ;OxO (16) 5 | TYPE1=0x02000000,0x00020002,0x57531600,1,0 6 | TYPE2=0x00020000,0x02000200,0x57531600,2,0 7 | TYPE3=0x00000200,0x00020002,0x57531600,3,0 8 | TYPE4=0x00000002,0x02000200,0x57531600,0,0 9 | 10 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/03_Highway/07_Highway_Monorail.txt: -------------------------------------------------------------------------------- 1 | [HighwayMonoRailIntersectionSolutions] 2 | ; 3 | ;DDRHW Specials (added by Tarkus, 06072012) 4 | ;OxO (17) 5 | TYPE1=0x02000000,0x00020002,0x57531700,1,0 6 | TYPE2=0x00020000,0x02000200,0x57531700,2,0 7 | TYPE3=0x00000200,0x00020002,0x57531700,3,0 8 | TYPE4=0x00000002,0x02000200,0x57531700,0,0 9 | 10 | -------------------------------------------------------------------------------- /src/main/scala/pathing/nwmpaths/Main.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.pathing.nwmpaths 2 | 3 | import io.github.memo33.scdbpf 4 | import com.sc4nam.module._, syntax.IdResolver 5 | 6 | object Main extends App { 7 | 8 | implicit val resolver: IdResolver = new RhwResolver orElse new MiscResolver orElse new NwmResolver 9 | val entries = PathCreator.generateNwmPaths 10 | val file = new java.io.File("target/nwmTurnPaths.dat") 11 | import scdbpf.strategy.throwExceptions 12 | scdbpf.DbpfFile.write(entries, file) 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/Ramp_2_R3_Branch_LHD.txt: -------------------------------------------------------------------------------- 1 | ;==Diagonal Tile and Adjacencies (R3 B1 Ramps)== 2 | ;----------------------- 3 | ;----L0 MIS (0x5702)---- 4 | ;----------------------- 5 | ;----Base Network---- 6 | ;02 to 02 (R3 Diag) 7 | 0x57B00A80,2,0,0x57000200,2,0=0x57B00A80,2,0,0x57020200,2,0 8 | 0x57B00A00,0,1,0x57000200,1,0=0x57B00A00,0,1,0x57020200,1,0 9 | ;00 to 00 (R3 Orth) 10 | 0x57B01A80,3,0,0x57000000,3,0=0x57B01A80,3,0,0x57020000,3,0 11 | 0x57B01A00,1,1,0x57000000,1,0=0x57B01A00,1,1,0x57020000,1,0 12 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/Ramp_2_R3_Branch_RHD.txt: -------------------------------------------------------------------------------- 1 | ;==Diagonal Tile and Adjacencies (R3 B1 Ramps)== 2 | ;----------------------- 3 | ;----L0 MIS (0x5702)---- 4 | ;----------------------- 5 | ;----Base Network---- 6 | ;02 to 02 (R3 Diag) 7 | 0x57B00A00,2,0,0x57000200,2,0=0x57B00A00,2,0,0x57020200,2,0 8 | 0x57B00A80,0,1,0x57000200,1,0=0x57B00A80,0,1,0x57020200,1,0 9 | ;00 to 00 (R3 Orth) 10 | 0x57B01A00,3,0,0x57000000,3,0=0x57B01A00,3,0,0x57020000,3,0 11 | 0x57B01A80,1,1,0x57000000,1,0=0x57B01A80,1,1,0x57020000,1,0 12 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7c_RHWxRHW/Supplement_WiderRHW_DxO.txt: -------------------------------------------------------------------------------- 1 | 0x57268010,3,0,0x57004A00,0,0=0x57268010,3,0,0x57267A40,1,0 ;include 2 | 0x57268050,3,0,0x57004A00,0,0=0x57268050,3,0,0x57267A00,1,0 ;include 3 | ; 4 | 0x57268055,0,0,0x57004A00,1,0=0x57268055,0,0,0x57268010,2,0 ;include 5 | 0x57268050,0,0,0x57004A00,1,0=0x57268050,0,0,0x57268015,2,0 ;include 6 | 0x57268015,0,0,0x57004A00,1,0=0x57268015,0,0,0x57268050,2,0 ;include 7 | 0x57268010,0,0,0x57004A00,1,0=0x57268010,0,0,0x57268055,2,0 ;include 8 | ; 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Controller/INRULs/AvenueAdvanced/RUL0E_Avenue_Advanced_Header.rul: -------------------------------------------------------------------------------- 1 | #RoadRules# 2 | 3 | ;NOTE; file has been modified, has some sections throughout commented out, 4 | ; has custom content, & contains various additional rules, done by Simtropolis Modd Squad &/or others. 5 | 6 | ;NOTE FROM the7trumpets: 7 | ;The following sections have been manually rotated and flipped to 8 | ;allow this file to be a road rules type file instead of a 9 | ;transmogrify file, so that the turning lanes tiles do not get 10 | ;incorrectly flipped. 11 | ;; 12 | ;; 13 | -------------------------------------------------------------------------------- /src/main/scala/module/flexfly/CompileFlexFlyCode.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | package flexfly 3 | 4 | import java.io.File 5 | import syntax.{RuleGenerator, IdResolver, RuleTransducer} 6 | 7 | /** Outputs FlexFly RUL2 code to 'target/Sec7j_FLEXFly_MANAGED.txt' 8 | */ 9 | object CompileFlexFlyCode extends AbstractMain { 10 | 11 | lazy val resolve: IdResolver = new FlexFlyResolver orElse new RhwResolver 12 | val generator = new FlexFlyRuleGenerator(_) 13 | lazy val file = new File("target/Sec7j_FLEXFly_MANAGED.txt") 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/scala/module/CompileRealRailwayCode.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import java.io.File 4 | import syntax.{RuleGenerator, IdResolver, RuleTransducer} 5 | 6 | /** Outputs RRW RUL2 code to 'target/Sec11r_RRW_MANAGED.txt' 7 | */ 8 | object CompileRealRailwayCode extends AbstractMain { 9 | 10 | lazy val resolve: IdResolver = new RealRailwayResolver orElse new SamResolver orElse new RhwResolver orElse new MiscResolver orElse new NwmResolver orElse new ViaductResolver 11 | val generator = new RealRailwayRuleGenerator(_) 12 | lazy val file = new File("target/Sec11r_RRW_MANAGED.txt") 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/scala/module/flexfly/FlexFlyResolverSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | package flexfly 3 | 4 | import org.scalatest.wordspec.AnyWordSpec 5 | import org.scalatest.matchers.should.Matchers 6 | 7 | class FlexFlyResolverSpec extends AnyWordSpec with Matchers { 8 | "FlexFlyResolver" should { 9 | "be a 1-to-1 correspondence (bijective)" in { 10 | val resolve = new FlexFlyResolver 11 | val reverseTileMap = resolve.tileMap.map { case (a, b) => (b, a) } 12 | for ((tile, idTile) <- resolve.tileMap) { 13 | reverseTileMap(idTile).shouldBe(tile) 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ltext/synchronize-translations.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script runs msgmerge on every .po file to synchronize them with the 3 | # corresponding English template .pot files. 4 | set -e 5 | # first change to ltext directory, so script can be run from anywhere 6 | cd "${0%/*}" 7 | 8 | for lang in */ ; do 9 | echo "synchronizing $lang" 10 | for pofile in "$lang"*.po ; do 11 | potfile="${pofile##*/}t" 12 | msgmerge --update --previous --no-wrap --backup=off --quiet "$pofile" "$potfile" 13 | done 14 | done 15 | 16 | # Note: To fix line wrapping of a .po file use: 17 | # msgcat --no-wrap -o 18 | -------------------------------------------------------------------------------- /Controller/RUL1/00_head.txt: -------------------------------------------------------------------------------- 1 | ;;NOTE; file has been modified, has some sections throughout commented out, 2 | ; has custom content, & contains various additional rules, done by NAM Team &/or others. 3 | ; Updated: 1 May 2013, by Tarkus (r181) 4 | ; fixes RTL initialization 5 | ; 6 | ; format: 7 | ; [NetworkName1NetworkName2IntersectionSolutions] 8 | ; anything=Network1CheckFlag,Network2CheckFlag,InstanceID,Rotation,Flip 9 | ; NetworkName1 & NetworkName2 in the Header require specific loading order in order for subsequent rules to work. 10 | ; Networkcheckflags; 0xSouth/East/North/West. Only simple checkflags allowed/used 11 | ; Rotation 0-3 12 | ; Flip 0-1 13 | ; 14 | ; 15 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/00_head.txt: -------------------------------------------------------------------------------- 1 | ;;NOTE; file has been modified, has some sections throughout commented out, 2 | ; has custom content, & contains various additional rules, done by NAM Team &/or others. 3 | ; Updated: 1 May 2013, by Tarkus (r181) 4 | ; fixes RTL initialization 5 | ; 6 | ; format: 7 | ; [NetworkName1NetworkName2IntersectionSolutions] 8 | ; anything=Network1CheckFlag,Network2CheckFlag,InstanceID,Rotation,Flip 9 | ; NetworkName1 & NetworkName2 in the Header require specific loading order in order for subsequent rules to work. 10 | ; Networkcheckflags; 0xSouth/East/North/West. Only simple checkflags allowed/used 11 | ; Rotation 0-3 12 | ; Flip 0-1 13 | ; 14 | ; 15 | -------------------------------------------------------------------------------- /Controller/RUL1/02_Rail/10_Rail_Subway.txt: -------------------------------------------------------------------------------- 1 | [RailSubwayIntersectionSolutions] 2 | ;Designed by jondor on January 28, 2011 3 | ; 4 | TYPE1=0x00010100,0x02000200,0x06700000,0,0 5 | TYPE2=0x01010000,0x00020002,0x06700000,1,0 6 | TYPE3=0x01000001,0x02000200,0x06700000,2,0 7 | TYPE4=0x00000101,0x00020002,0x06700000,3,0 8 | ; 9 | TYPE1=0x00010300,0x02000200,0x53e63730,0,0 10 | TYPE2=0x01030000,0x00020002,0x53e63730,1,0 11 | TYPE3=0x03000001,0x02000200,0x53e63730,2,0 12 | TYPE4=0x00000103,0x00020002,0x53e63730,3,0 13 | 14 | TYPE1=0x00030300,0x02000200,0x53e63700,0,0 15 | TYPE2=0x03030000,0x00020002,0x53e63700,1,0 16 | TYPE3=0x03000003,0x02000200,0x53e63700,2,0 17 | TYPE4=0x00000303,0x00020002,0x53e63700,3,0 18 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/02_Rail/10_Rail_Subway.txt: -------------------------------------------------------------------------------- 1 | [RailSubwayIntersectionSolutions] 2 | ;Designed by jondor on January 28, 2011 3 | ; 4 | TYPE1=0x00010100,0x02000200,0x06700000,0,0 5 | TYPE2=0x01010000,0x00020002,0x06700000,1,0 6 | TYPE3=0x01000001,0x02000200,0x06700000,2,0 7 | TYPE4=0x00000101,0x00020002,0x06700000,3,0 8 | ; 9 | TYPE1=0x00010300,0x02000200,0x53e63730,0,0 10 | TYPE2=0x01030000,0x00020002,0x53e63730,1,0 11 | TYPE3=0x03000001,0x02000200,0x53e63730,2,0 12 | TYPE4=0x00000103,0x00020002,0x53e63730,3,0 13 | 14 | TYPE1=0x00030300,0x02000200,0x53e63700,0,0 15 | TYPE2=0x03030000,0x00020002,0x53e63700,1,0 16 | TYPE3=0x03000003,0x02000200,0x53e63700,2,0 17 | TYPE4=0x00000303,0x00020002,0x53e63700,3,0 18 | -------------------------------------------------------------------------------- /Controller/RUL1/02_Rail/11_Rail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [RailGroundHighwayIntersectionSolutions] 2 | 3 | ;Goundhighway-Rail-Overpath Orthogonal 4 | TYPE1=0x00000000,0x02040200,0x0a001500,3,0 5 | TYPE2=0x00000000,0x00020402,0x0a001500,2,0 6 | TYPE1=0x00000000,0x02000204,0x0a001500,1,0 7 | TYPE2=0x00000000,0x04020002,0x0a001500,0,0 8 | ; 9 | ;Groundhighway-Rail-Overpath Diagonal middle 10 | TYPE1=0x00000000,0x03010301,0x0a002100,0,0 11 | TYPE2=0x00000000,0x01030103,0x0a002100,1,0 12 | ; 13 | ;Groundhighway-Rail-Overpath Diagonal edge 14 | TYPE1=0x00000000,0x03010000,0x0a002200,0,0 15 | TYPE2=0x00000000,0x01000003,0x0a002200,1,0 16 | TYPE1=0x00000000,0x00000301,0x0a002200,2,0 17 | TYPE2=0x00000000,0x00030100,0x0a002200,3,0 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/02_Rail/11_Rail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [RailGroundHighwayIntersectionSolutions] 2 | 3 | ;Goundhighway-Rail-Overpath Orthogonal 4 | TYPE1=0x00000000,0x02040200,0x0a001500,3,0 5 | TYPE2=0x00000000,0x00020402,0x0a001500,2,0 6 | TYPE1=0x00000000,0x02000204,0x0a001500,1,0 7 | TYPE2=0x00000000,0x04020002,0x0a001500,0,0 8 | ; 9 | ;Groundhighway-Rail-Overpath Diagonal middle 10 | TYPE1=0x00000000,0x03010301,0x0a002100,0,0 11 | TYPE2=0x00000000,0x01030103,0x0a002100,1,0 12 | ; 13 | ;Groundhighway-Rail-Overpath Diagonal edge 14 | TYPE1=0x00000000,0x03010000,0x0a002200,0,0 15 | TYPE2=0x00000000,0x01000003,0x0a002200,1,0 16 | TYPE1=0x00000000,0x00000301,0x0a002200,2,0 17 | TYPE2=0x00000000,0x00030100,0x0a002200,3,0 -------------------------------------------------------------------------------- /Controller/INRULs/StreetBasic/RUL09_Street_Basic_Header.rul: -------------------------------------------------------------------------------- 1 | #RoadRules# 2 | 3 | ;--------------------------------------------------------------- 4 | ; Network Addon Mod 5 | ; Street RUL with Diagonal Streets 6 | ; { 0x0A5BCF4B - 0xAA5BCF57 - 0x00000009 } 7 | ; 8 | ; Component Order: 9 | ; - This 10 | ; - StreetBasic.rul 11 | ; - FractionalAngle.rul 12 | ; 13 | ; * See RULConfig.txt * 14 | ; 15 | ;--------------------------------------------------------------- 16 | ; 17 | ; Note: This file has been split into smaller components 18 | ; to facilitate maintainability and to enable compiling 19 | ; INRULs with different features enabled. 20 | ; 21 | ;--------------------------------------------------------------- 22 | 23 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7c_RHWxRHW/Supplement_L1L2_RHW-2xL0_RHW-2_OxO.txt: -------------------------------------------------------------------------------- 1 | ; 2 | ;L1 RHW2 x L0 RHW2 OxO, 2021-08-06, McDuell 3 | ;(supplement to RhwMetaGenerated.txt) 4 | ; 5 | ;0x57101a00,1,0,0x57000000,1,0=0x57101a00,1,0,0x57100000,1,0 6 | 0x57101a00,3,0,0x57000000,1,0=0x57101a00,3,0,0x57100000,1,0 7 | 0x57101a00,1,0,0x57000000,3,0=0x57101a00,1,0,0x57100000,3,0 8 | ;0x57101a00,3,0,0x57000000,3,0=0x57101a00,3,0,0x57100000,3,0 9 | ; 10 | ;L2 RHW2 x L0 RHW2 OxO, 2021-08-06, McDuell 11 | ;(supplement to RhwMetaGenerated.txt) 12 | ; 13 | ;0x57201a00,1,0,0x57000000,1,0=0x57201a00,1,0,0x57200000,1,0 14 | 0x57201a00,3,0,0x57000000,1,0=0x57201a00,3,0,0x57200000,1,0 15 | 0x57201a00,1,0,0x57000000,3,0=0x57201a00,1,0,0x57200000,3,0 16 | ;0x57201a00,3,0,0x57000000,3,0=0x57201a00,3,0,0x57200000,3,0 -------------------------------------------------------------------------------- /Lite Controller/RUL2/Sec0_Head.txt: -------------------------------------------------------------------------------- 1 | [RuleOverrides] 2 | ;NOTE; file has been modified, has some sections throughout commented out, 3 | ; has custom content, & contains various additional rules, done by NAM Team &/or others. 4 | ; Updated: 24 May 2013 by Tarkus (r182--see Controller LTEXT for e/s info) 5 | ; 6 | ; 7 | ; 8 | ; 9 | ; Format; 10 | ; LeftTileID,Rotation,Flip,RightTileID,Rotation,Flip=LeftTileIDReplacement,Rotation,Flip,RightTileIDReplacement,Rotation,Flip 11 | ; "ID" refers to starting InstanceID of tile in-game. ID can be FSH or Exemplar. Path file should also be present. 12 | ; "Replacement" refers to the starting Instance ID that will be used as the replacement for the Tile in question. 13 | ; Rotation 0-3. Rotation goes clockwise. If flip=1 Rotation goes counterclockwise. 14 | ; Flip 0 or 1 -------------------------------------------------------------------------------- /Controller/RUL2/00_Head/Sec0_Head.txt: -------------------------------------------------------------------------------- 1 | [RuleOverrides] 2 | ;NOTE; file has been modified, has some sections throughout commented out, 3 | ; has custom content, & contains various additional rules, done by NAM Team &/or others. 4 | ; Updated: 24 May 2013 by Tarkus (r182--see Controller LTEXT for e/s info) 5 | ; 6 | ; 7 | ; 8 | ; 9 | ; Format; 10 | ; LeftTileID,Rotation,Flip,RightTileID,Rotation,Flip=LeftTileIDReplacement,Rotation,Flip,RightTileIDReplacement,Rotation,Flip 11 | ; "ID" refers to starting InstanceID of tile in-game. ID can be FSH or Exemplar. Path file should also be present. 12 | ; "Replacement" refers to the starting Instance ID that will be used as the replacement for the Tile in question. 13 | ; Rotation 0-3. Rotation goes clockwise. If flip=1 Rotation goes counterclockwise. 14 | ; Flip 0 or 1 -------------------------------------------------------------------------------- /Controller/INRULs/StreetAdvanced/RUL0A_Street_Advanced_Header.rul: -------------------------------------------------------------------------------- 1 | #RoadRules# 2 | 3 | ;--------------------------------------------------------------- 4 | ; 5 | ; Network Addon Mod 6 | ; Advanced Street INRUL 7 | ; { 0x0A5BCF4B - 0xAA5BCF57 - 0x0000000A } 8 | ; 9 | ; Component Order: 10 | ; - This 11 | ; - FractionalAngle.rul 12 | ; - Roundabouts.rul 13 | ; - WideRadiusCurves.rul 14 | ; - Miscellaneous.rul 15 | ; 16 | ; * See RULConfig.txt * 17 | ; 18 | ;--------------------------------------------------------------- 19 | ; 20 | ; Note: This file has been split into smaller components 21 | ; to facilitate maintainability and to enable compiling 22 | ; INRULs with different features enabled. 23 | ; 24 | ;--------------------------------------------------------------- 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | /Controller/**/*_MANAGED.rul 4 | /Controller/**/*_MANAGED.txt 5 | 6 | *.dat 7 | *.mo 8 | *.po~ 9 | *.bak 10 | Controller/RUL0/5000_RHW/5300_Transitions.txt 11 | Controller/RUL0/7000_Road_NWM/7D00_FractionalAngledStreets.txt 12 | Controller/RUL1/01_Road/04_Road_Street.txt 13 | Controller/RUL1/01_Road/08_Road_OneWayRoad.txt 14 | Controller/RUL1/05_Avenue/09_Avenue_Dirtroad.txt 15 | Controller/RUL2/05_FA_WRC/Sec5a_FA_Street.txt 16 | Controller/RUL2/07_RHW/Sec7h_FlexHT-OST/Sec7h4_FlexHT_Diagonal_Variants.txt 17 | Controller/RUL1/05_Avenue/09_Avenue_Dirtroad.txt 18 | Controller/RUL1/05_Avenue/09_Avenue_Dirtroad.txt 19 | Controller/RUL2/08_NWM/Sec8k_NWM_OWR_MRC.txt 20 | Controller/INRULs/RULConfig.txt 21 | Sec7i_FLEXRamp-V2.txt 22 | Controller/INRULs/RULConfig.txt 23 | Controller/INRULs/RULConfig.txt 24 | *.json 25 | *.log 26 | -------------------------------------------------------------------------------- /Controller/RUL2/06_Road_Viaducts/Sec6c_additions.txt: -------------------------------------------------------------------------------- 1 | ;L1 2 | ; 3 | ; 4 | 0x5c021505,0,0,0x5c021500,2,0=0x5c021505,0,0,0x5c021505,2,0 5 | ; 6 | ;L2 7 | 0x5c051505,0,0,0x5c051500,2,0=0x5c051505,0,0,0x5c051505,2,0 8 | 9 | ;L2MHOxL1Road - MGB Mar2019 10 | ;=============================================================================== 11 | ; ADDS Support for creating t-intersections with MIS using L1 Drag Road Viaducts 12 | ;=============================================================================== 13 | ;L0 Road x L2 MHO next MIS + --> L1 Road 14 | ;L0 Road x L2 MHO next MIS T --> L1 Road 15 | 0x02014000,2,0,0x57620110,2,0=0x5C001420,1,0,0x57620110,2,0 16 | 0x02014000,2,0,0x57620190,2,0=0x5C001420,1,0,0x57620190,2,0 17 | ;DualTile Stability 18 | 0x02014000,0,0,0x5C001420,1,0=0x5C001420,3,0,0x5C001420,1,0 19 | 0x5C001420,3,0,0x02014000,2,0=0x5C001420,3,0,0x5C001420,1,0 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us fix issues in the NAM. 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please delete as appropriate):** 27 | - Windows 28 | - MacOS (either ARM or Intel x86) 29 | - Linux (optionally describe which distro you are using) 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/Sec8b_NWM_STR.txt: -------------------------------------------------------------------------------- 1 | ;additions to NWMxSTR stability by Swordmaster 18 January 2016 2 | ;NWM stability 3 | 0x5d342000,0,0,0x51111500,1,0=0x51111f00,3,0,0x51111f00,1,0 4 | 0x5d342000,2,0,0x51111500,1,0=0x51111f00,3,0,0x51111f00,1,0 5 | 0x51110000,1,0,0x5d342000,3,0=0x51110000,1,0,0x51111f00,0,0 6 | 0x51110000,1,0,0x5d342000,1,0=0x51110000,1,0,0x51111f00,0,0 7 | 0x51110000,3,0,0x5d342000,1,0=0x51110000,3,0,0x51111f00,2,0 8 | 0x51110000,3,0,0x5d342000,3,0=0x51110000,3,0,0x51111f00,2,0 9 | ; 10 | 0x5d342000,0,0,0x51121500,1,0=0x51121f00,3,0,0x51121f00,1,0 11 | 0x5d342000,2,0,0x51121500,1,0=0x51121f00,3,0,0x51121f00,1,0 12 | 0x51120000,1,0,0x5d342000,3,0=0x51120000,1,0,0x51121f00,0,0 13 | 0x51120000,1,0,0x5d342000,1,0=0x51120000,1,0,0x51121f00,0,0 14 | 0x51120000,3,0,0x5d342000,1,0=0x51120000,3,0,0x51121f00,2,0 15 | 0x51120000,3,0,0x5d342000,3,0=0x51120000,3,0,0x51121f00,2,0 -------------------------------------------------------------------------------- /Controller/RUL2/11_Rail/Sec11b_RAM-RRW_conversioncode.txt: -------------------------------------------------------------------------------- 1 | ; RAM-RRW STR conversion code 2 | ; old STR + new DTR ortho 3 | 0x5d300000,1,0,0x5d540000,1,0=0x5d500000,1,0,0x5d500000,1,0 4 | 0x5d300000,3,0,0x5d540000,1,0=0x5d500000,3,0,0x5d500000,1,0 5 | 0x5d300000,1,0,0x5d540000,3,0=0x5d500000,1,0,0x5d500000,3,0 6 | 0x5d300000,3,0,0x5d540000,3,0=0x5d500000,3,0,0x5d500000,3,0 7 | ; old STR + new DTR dia 8 | 0x5d302000,0,0,0x5d540100,2,0=0x5d500100,0,0,0x5d500100,2,0 9 | 0x5d302000,0,0,0x5d540100,3,1=0x5d500100,0,0,0x5d500100,3,1 10 | 0x5d302000,1,1,0x5d540100,2,0=0x5d500100,1,1,0x5d500100,2,0 11 | 0x5d302000,1,1,0x5d540100,3,1=0x5d500100,1,1,0x5d500100,3,1 12 | 0x5d302000,3,0,0x5d540100,1,0=0x5d500100,3,0,0x5d500100,1,0 13 | 0x5d302000,3,0,0x5d540100,0,1=0x5d500100,3,0,0x5d500100,0,1 14 | 0x5d302000,2,1,0x5d540100,1,0=0x5d500100,2,1,0x5d500100,1,0 15 | 0x5d302000,2,1,0x5d540100,0,1=0x5d500100,2,1,0x5d500100,0,1 16 | ; -------------------------------------------------------------------------------- /Controller/RUL2/03_Turn_Lanes/Sec3f_FTL_Adjacent_ERRW.txt: -------------------------------------------------------------------------------- 1 | ;------------------(Sec3F_FTLxERRW) Adjacentices------------; 2 | ;(Level #1 ERRW) 3 | ; 4 | ;Single Tile Flex Turn Lanes; 5 | ; 6 | ; 7 | ; 8 | ;Dual Tile Flex Turn Lanes; 9 | ; 10 | ; 11 | 0x5B32001E,1,1,0x5D671300,0,0=0x5B32001E,1,1,0x5B32001E,1,1 ;LHD 12 | 0x5B32009E,1,1,0x5D671300,2,0=0x5B32009E,1,1,0x5B32009E,1,1 ;LHD 13 | 0x5B32001E,1,1,0x5D671300,0,0=0x5B32001E,1,1,0x5B32001E,1,1 ;LHD 14 | 0x5B32009E,1,1,0x5D671300,2,0=0x5B32009E,1,1,0x5B32009E,1,1 ;LHD 15 | ; 16 | ;(Level #2 ERRW) 17 | ; 18 | ;Single Tile Flex Turn Lanes; 19 | ; 20 | ; 21 | ; 22 | ;Dual Tile Flex Turn Lanes; 23 | ; 24 | ; 25 | 0x5B32002E,1,1,0x5D771300,0,0=0x5B32002E,1,1,0x5B32002E,1,1 ;LHD 26 | 0x5B3200AE,1,1,0x5D771300,2,0=0x5B3200AE,1,1,0x5B3200AE,1,1 ;LHD 27 | 0x5B32002E,1,1,0x5D771300,0,0=0x5B32002E,1,1,0x5B32002E,1,1 ;LHD 28 | 0x5B3200AE,1,1,0x5D771300,2,0=0x5B3200AE,1,1,0x5B3200AE,1,1 ;LHD 29 | ; -------------------------------------------------------------------------------- /Controller/INRULs/AvenueAdvanced/README_RUL0E.txt: -------------------------------------------------------------------------------- 1 | There are two advanced Avenue INRUL files contained in the NAM. The main one is included with all the other INRUL files. The other one is used in the legacy Avenue Auto Turn Lanes plugin. 2 | 3 | Since it is installed optionally and there is no compilation routine in the installer, the turning lanes rul file contains all the INRUL from the original file, plus the turn lanes INRUL. 4 | 5 | Both RUL0E files are fully specified #roadrules# INRUL files rather than making use of transmogrify in order to avoid some mirroring problems. 6 | 7 | THEREFORE, if changes are to be made to the base avenue advanced INRUL, then also an updated copy of RUL0E should be placed into the legacy turn lanes .dat file currently located at 8 | 9 | installation\2 Additional Network Features\Road, One-Way Road, and Avenue\!Legacy Auto Avenue Turn Lanes\NetworkAddonMod_TurningLanes_Avenues_Plugin_INRULs.dat 10 | -------------------------------------------------------------------------------- /src/test/scala/module/ReverseResolverSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | import io.github.memo33.metarules.meta._ 6 | import syntax._, Implicits._, RotFlip._, Network._, Flags._, NetworkProperties._ 7 | 8 | class ReverseResolverSpec extends AnyWordSpec with Matchers { 9 | 10 | "ReverseResolver" should { 11 | "find all possible orientations of a tile" in { 12 | val preimage = new ReverseResolver(Map((0x00004b00, ::(Road~NS, Nil)))) 13 | for (rf <- RotFlip.values) { 14 | preimage(IdTile(0x00004b00, rf)).shouldBe(Seq[Tile](Road~NS * rf)) 15 | } 16 | } 17 | "find multiple inequivalent tiles if they map to the same ID" in { 18 | val t1: Tile = Street~(2,2,2,2) 19 | val t2: Tile = Street~NS & Street~EW 20 | val preimage = new ReverseResolver(Map((0x05020700, ::(t1, t2 :: Nil)))) 21 | preimage(0x05020700).toSet.shouldBe(Set(t1, t2)) 22 | preimage(IdTile(0x05020700,0,0)).toSet.shouldBe(Set(t1, t2)) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/ST_Shared_Tile_Fixes.txt: -------------------------------------------------------------------------------- 1 | ;Override of Road Roundabouts for Shared-Tile Road Ints 2 | 3 | ;Dual Orth Road x Double Diagonal Shared-Tile Road 4 | 0x00003900,1,0,0x5F06CB00,2,1=0x00003900,1,0,0x5F046000,0,0 5 | 0x00003900,3,1,0x5F06CB00,0,0=0x00003900,3,1,0x5F046000,0,1; conflicting-override 6 | ; 7 | 0x5F046000,0,0,0x5F06BB00,1,0=0x5F046000,0,0,0x00003900,3,0; missing_paths 8 | 0x5F046000,0,0,0x5F06BA00,3,1=0x5F046000,0,0,0x00003900,3,0 9 | 10 | 0x5F046000,0,1,0x5F06BA00,1,0=0x5F046000,0,1,0x00003900,1,1 11 | 0x5F046000,0,1,0x5F06BB00,3,1=0x5F046000,0,1,0x00003900,1,1; missing_paths 12 | 13 | 0x5F046000,2,0,0x5F06BB00,1,0=0x5F046000,2,0,0x00003900,3,0; missing_paths 14 | 0x5F046000,2,0,0x5F06BA00,3,1=0x5F046000,2,0,0x00003900,3,0 15 | 16 | 0x5F046000,2,1,0x5F06BA00,1,0=0x5F046000,2,1,0x00003900,1,1 17 | 0x5F046000,2,1,0x5F06BB00,3,1=0x5F046000,2,1,0x00003900,1,1; missing_paths 18 | 19 | ;Triple Tile Fix 20 | 0x00003900,0,0,0x5F06BD00,0,0=0x00003900,0,0,0x5F046000,1,0 21 | 0x00003900,0,0,0x5F06BD00,2,0=0x00003900,0,0,0x5F046000,1,0 22 | 0x00003900,2,1,0x5F06BD00,1,0=0x00003900,2,1,0x5F046000,1,1 23 | 0x00003900,2,1,0x5F06BD00,3,0=0x00003900,2,1,0x5F046000,1,1 -------------------------------------------------------------------------------- /Controller/RUL2/11_Rail/Sec11q_RRW_STR_Retexture.txt: -------------------------------------------------------------------------------- 1 | ;-----------------------; 2 | ;---[STR_Adjacentces]---; 3 | ;-----------------------; 4 | ; 5 | ;Minicurves 6 | ; 7 | 0x5d500000,1,0,0x5d548880,1,0=0x5d500000,1,0,0x5d508880,1,0 8 | 0x5d500000,3,0,0x5d548880,1,0=0x5d500000,3,0,0x5d508880,1,0 9 | 0x5d501500,0,0,0x5d548880,1,0=0x5d501500,0,0,0x5d508880,1,0 10 | 0x5d501500,2,1,0x5d548880,1,0=0x5d501500,2,1,0x5d508880,1,0 11 | ; 12 | ;Slip-Turnouts 13 | ; 14 | ; 15 | ;Multi-Radius-Curves 16 | ; 17 | ; 18 | ;FlexTrack-Components 19 | ; 20 | 0x5390c300,0,0,0x5d548880,1,0=0x5390c300,0,0,0x5d508880,1,0 21 | 0x5390c300,2,1,0x5d548880,1,0=0x5390c300,2,1,0x5d508880,1,0 22 | 0x53901000,2,0,0x5d548880,1,0=0x53900100,2,0,0x5d508880,1,0; missing_paths 23 | 0x53901000,0,1,0x5d548880,1,0=0x53900100,0,1,0x5d508880,1,0; missing_paths 24 | 0x53901780,2,0,0x5d548880,1,0=0x53901780,2,0,0x5d508880,1,0 25 | 0x53901780,0,1,0x5d548880,1,0=0x53901780,0,1,0x5d508880,1,0 26 | 0x53905300,0,0,0x5d548880,1,0=0x53905300,0,0,0x5d508880,1,0 27 | 0x53905300,2,1,0x5d548880,1,0=0x53905300,2,1,0x5d508880,1,0 28 | 0x53908200,0,0,0x5d548880,1,0=0x53908200,0,0,0x5d508880,1,0 29 | 0x53908200,2,1,0x5d548880,1,0=0x53908200,2,1,0x5d508880,1,0 30 | -------------------------------------------------------------------------------- /Controller/RUL1/08_OneWayRoad/11_OneWayRoad_Subway.txt: -------------------------------------------------------------------------------- 1 | [SubwayOneWayRoadIntersectionSolutions] 2 | ;Designed by Tarkus on August 3, 2020 3 | ;URoad-2 Ortho Starter 4 | TYPE1=0x02000200,0x00010100,0x06700000,0,0 5 | TYPE2=0x00020002,0x01010000,0x06700000,1,0 6 | TYPE3=0x02000200,0x01000001,0x06700000,2,0 7 | TYPE4=0x00020002,0x00000101,0x06700000,3,0 8 | 9 | ;URoad-3 Ortho Starter 10 | TYPE1=0x02000200,0x00010300,0x06710000,0,0 11 | TYPE2=0x00020002,0x01030000,0x06710000,1,0 12 | TYPE3=0x02000200,0x03000001,0x06710000,2,0 13 | TYPE4=0x00020002,0x00000103,0x06710000,3,0 14 | 15 | ;URamp Ortho Starter 16 | TYPE1=0x02000200,0x00030300,0x06720000,0,0 17 | TYPE2=0x00020002,0x03030000,0x06720000,1,0 18 | TYPE3=0x02000200,0x03000003,0x06720000,2,0 19 | TYPE4=0x00020002,0x00000303,0x06720000,3,0 20 | 21 | ;URoad-4 Ortho Starter 22 | TYPE1=0x02000200,0x00010400,0x06730000,0,0 23 | TYPE2=0x00020002,0x01040000,0x06730000,1,0 24 | TYPE3=0x02000200,0x04000001,0x06730000,2,0 25 | TYPE4=0x00020002,0x00000104,0x06730000,3,0 26 | 27 | ;URoad-6S Ortho Starter 28 | TYPE1=0x02000200,0x00030400,0x06740000,0,0 29 | TYPE2=0x00020002,0x03040000,0x06740000,1,0 30 | TYPE3=0x02000200,0x04000003,0x06740000,2,0 31 | TYPE4=0x00020002,0x00000304,0x06740000,3,0 -------------------------------------------------------------------------------- /Lite Controller/RUL1/08_OneWayRoad/11_OneWayRoad_Subway.txt: -------------------------------------------------------------------------------- 1 | [SubwayOneWayRoadIntersectionSolutions] 2 | ;Designed by Tarkus on August 3, 2020 3 | ;URoad-2 Ortho Starter 4 | TYPE1=0x02000200,0x00010100,0x06700000,0,0 5 | TYPE2=0x00020002,0x01010000,0x06700000,1,0 6 | TYPE3=0x02000200,0x01000001,0x06700000,2,0 7 | TYPE4=0x00020002,0x00000101,0x06700000,3,0 8 | 9 | ;URoad-3 Ortho Starter 10 | TYPE1=0x02000200,0x00010300,0x06710000,0,0 11 | TYPE2=0x00020002,0x01030000,0x06710000,1,0 12 | TYPE3=0x02000200,0x03000001,0x06710000,2,0 13 | TYPE4=0x00020002,0x00000103,0x06710000,3,0 14 | 15 | ;URamp Ortho Starter 16 | TYPE1=0x02000200,0x00030300,0x06720000,0,0 17 | TYPE2=0x00020002,0x03030000,0x06720000,1,0 18 | TYPE3=0x02000200,0x03000003,0x06720000,2,0 19 | TYPE4=0x00020002,0x00000303,0x06720000,3,0 20 | 21 | ;URoad-4 Ortho Starter 22 | TYPE1=0x02000200,0x00010400,0x06730000,0,0 23 | TYPE2=0x00020002,0x01040000,0x06730000,1,0 24 | TYPE3=0x02000200,0x04000001,0x06730000,2,0 25 | TYPE4=0x00020002,0x00000104,0x06730000,3,0 26 | 27 | ;URoad-6S Ortho Starter 28 | TYPE1=0x02000200,0x00030400,0x06740000,0,0 29 | TYPE2=0x00020002,0x03040000,0x06740000,1,0 30 | TYPE3=0x02000200,0x04000003,0x06740000,2,0 31 | TYPE4=0x00020002,0x00000304,0x06740000,3,0 -------------------------------------------------------------------------------- /src/test/scala/module/flexfly/CompileFlexFlyRul0And1Spec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | package flexfly 3 | 4 | import syntax.Tile 5 | import CompileFlexFlyRul0And1._ 6 | import org.scalatest.wordspec.AnyWordSpec 7 | import org.scalatest.matchers.should.Matchers 8 | 9 | class CompileFlexFlyRul0And1Spec extends AnyWordSpec with Matchers { 10 | 11 | "FlexFly RUL1 falsies" should { 12 | "be permanent" in { 13 | scala.util.Using.resource(new java.util.Scanner(getClass.getResourceAsStream("/FlexFlyRUL1.txt"))) { scanner => 14 | import scala.jdk.CollectionConverters._ 15 | val previousFalsies = scanner.asScala.filter(_.nonEmpty).toSeq 16 | 17 | val resolve = new FlexFlyResolver 18 | val currentFalsies = (for { 19 | seg <- flexFlySegs.iterator 20 | idTile = resolve(Tile(seg)) 21 | falsie = convertVirtualTile(seg) 22 | line <- rul1Entry(falsie, idTile.id, seg.toString).linesIterator 23 | if line.nonEmpty 24 | } yield line).toSeq 25 | 26 | assert(previousFalsies sameElements currentFalsies, 27 | "FlexFly falsies were different from specification, but they should NEVER change!") 28 | } 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/BR_Bridge_Initialization.txt: -------------------------------------------------------------------------------- 1 | ;-----NWM Bridge Support----- 2 | ;Added by Tarkus on 18-Dec-2015 to support eggman121 bridges for NAM 34 3 | ;TLA-5-to-Avenue Bridge Start (overrides Avenue stub and bridge adjacency) 4 | 0x51100100,1,0,0x04007300,1,1=0x51100000,1,0,0x51100000,1,0 5 | 0x51100100,3,1,0x04007300,3,0=0x51100000,3,0,0x51100000,3,0; conflicting-override 6 | ;disconnector method 7 | 0x51100100,1,0,0x00000000,0,0=0x51100000,1,0,0x00000000,0,0 8 | 0x51100100,3,1,0x00000000,0,0=0x51100000,3,0,0x00000000,0,0 9 | ;RD-4 Bridge Start (overrides Avenue stub and bridge adjacency) 10 | 0x51130100,1,0,0x04007300,1,1=0x51130000,1,0,0x51130000,1,0 11 | 0x51130100,3,1,0x04007300,3,0=0x51130000,3,0,0x51130000,3,0; conflicting-override 12 | ;disconnector method 13 | 0x51130100,1,0,0x00000000,0,0=0x51130000,1,0,0x00000000,0,0 14 | 0x51130100,3,1,0x00000000,0,0=0x51130000,3,0,0x00000000,0,0 15 | ;RD-6 Bridge Start (overrides Avenue stub and bridge adjacency) 16 | 0x51140100,1,0,0x04007300,1,1=0x51140000,1,0,0x51140000,1,0 17 | 0x51140100,3,1,0x04007300,3,0=0x51140000,3,0,0x51140000,3,0; conflicting-override 18 | ;disconnector method 19 | 0x51140100,1,0,0x00000000,0,0=0x51140000,1,0,0x00000000,0,0 20 | 0x51140100,3,1,0x00000000,0,0=0x51140000,3,0,0x00000000,0,0 21 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/43b_Avenue_OxO_T_NWM.txt: -------------------------------------------------------------------------------- 1 | ;Ortho Tile Template 2 | ;------------------------- 3 | ;----L0 ARD-3 (0x5102)---- 4 | ;------------------------- 5 | ;----Base Network---- 6 | ;00 to 00 (Orth) 7 | 0x51024380,2,0,0x00004b00,1,0=0x51024380,2,0,0x51020000,1,0 8 | 0x51024380,2,0,0x00004b00,3,0=0x51024380,2,0,0x51020000,1,0 9 | 0x51024380,0,1,0x00004b00,1,0=0x51024380,0,1,0x51020000,3,0 10 | 0x51024380,0,1,0x00004b00,3,0=0x51024380,0,1,0x51020000,3,0 11 | ;00 to 01 (Orth Stub) 12 | ;00 to 04 (Orth-Diag) 13 | ;00 to 08 (90-Bend) 14 | ;----Other Base Crossings---- 15 | ;----Other Network Transitions---- 16 | ;---Orthogonal Transition Hooks--- 17 | ;for full transition code - see TR - Transitions file 18 | 0x51024380,2,0,0x51000100,3,0=0x51024380,2,0,0x5102E100,3,0 19 | 0x51024380,0,1,0x51000100,3,0=0x51024380,0,1,0x5102E100,1,1 20 | 0x51020000,1,0,0x5700F100,3,0=0x51020000,1,1,0x5102E500,3,0 21 | 0x51020000,1,0,0x5700F100,1,1=0x51020000,1,1,0x5102E500,3,0 22 | ;----Special---- 23 | ;--Roundabouts-- 24 | ;--MRCs-- 25 | ;Small 90 26 | ; 27 | ; 28 | ; 29 | ;--FA-- 30 | ;--FTLs-- 31 | 0x51020000,0,0,0x5B2A0000,1,0=0x5B2A0600,0,1,0x5B2A0000,1,0 32 | 0x51020000,2,0,0x5B2A0000,1,0=0x5B2A0609,0,1,0x5B2A0000,1,0 33 | ;--Slip Lanes-- 34 | ;--SITAP-- 35 | ;--FLEXHeight-- 36 | ;--FLEXOnSlope-- 37 | ;------------------ 38 | ;---END L0 ARD-3--- 39 | ;------------------ -------------------------------------------------------------------------------- /.github/workflows/scala.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | 6 | name: Scala CI 7 | 8 | on: 9 | push: 10 | pull_request: 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | with: 21 | persist-credentials: false 22 | - name: Set up JDK 21 23 | uses: actions/setup-java@v4 24 | with: 25 | java-version: '21' 26 | distribution: 'temurin' 27 | cache: 'sbt' 28 | - uses: sbt/setup-sbt@v1 29 | - name: Run tests 30 | run: sbt test 31 | - name: Generate locale files 32 | run: sbt generateLocales 33 | - name: Check for new conflicting RUL2 overrides 34 | run: SBT_OPTS="-Xmx2G" sbt conflictingOverridesCheck 35 | - name: Check for new segment orientation issues in RUL2 overrides 36 | run: sbt "runMain com.sc4nam.scripts.SegmentOrientationChecker" 37 | 38 | lint: 39 | runs-on: ubuntu-latest 40 | steps: 41 | - uses: actions/checkout@v4 42 | with: 43 | persist-credentials: false 44 | - name: Check RUL2 syntax 45 | run: sh src/scripts/syntax-check-rul2.sh 46 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/0F_Emergency_Lane.txt: -------------------------------------------------------------------------------- 1 | ;Emergency Lane Supplement 2 | ;Orth Continuation 3 | 0x57030F00,1,0,0x05004B00,1,0=0x57030F00,1,0,0x57030F00,1,0 4 | 0x57030F00,1,0,0x05004B00,3,0=0x57030F00,1,0,0x57030F00,1,0 5 | 0x57030F00,3,0,0x05004B00,1,0=0x57030F00,3,0,0x57030F00,3,0 6 | 0x57030F00,3,0,0x05004B00,3,0=0x57030F00,3,0,0x57030F00,3,0 7 | ;From OxO + 8 | 0x57031000,0,0,0x05004B00,1,0=0x57031000,0,0,0x57030F00,1,0 9 | 0x57031000,0,0,0x05004B00,3,0=0x57031000,0,0,0x57030F00,3,0 10 | ;From OxO Long-T 11 | 0x57630000,0,0,0x05004B00,1,0=0x57630000,0,0,0x57030F00,1,0 12 | 0x57630000,0,0,0x05004B00,3,0=0x57630000,0,0,0x57030F00,3,0 13 | ;From DxO + 14 | 0x57037080,2,0,0x05004B00,1,0=0x57037080,2,0,0x57030F00,1,0 15 | 0x57037080,2,0,0x05004B00,3,0=0x57037080,2,0,0x57030F00,3,0 16 | 0x57037080,0,1,0x05004B00,1,0=0x57037080,0,1,0x57030F00,1,0 17 | 0x57037080,0,1,0x05004B00,3,0=0x57037080,0,1,0x57030F00,3,0 18 | ;Diag Continuation 19 | 0x57030F09,0,0,0x5F500200,2,0=0x57030F09,0,0,0x57030F09,2,0 20 | 0x57030F09,3,0,0x5F500200,1,0=0x57030F09,3,0,0x57030F09,1,0 21 | ;From OxD + 22 | 0x57034080,0,1,0x5F500200,2,0=0x57034080,0,1,0x57030F09,2,0 23 | 0x57034080,2,0,0x5F500200,1,0=0x57034080,2,0,0x57030F09,1,0 24 | ;From DxD + 25 | 0x5703A080,0,1,0x5F500200,2,0=0x5703A080,0,1,0x57030F09,2,0 26 | 0x5703A080,2,0,0x5F500200,1,0=0x5703A080,2,0,0x57030F09,1,0 27 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/3Ad_ARD-3_OxO_+_NWM.txt: -------------------------------------------------------------------------------- 1 | ;Ortho Tile Template 2 | 3 | ;------------------------- 4 | ;----L0 ARD-3 (0x5102)---- 5 | ;------------------------- 6 | ;----Base Network---- 7 | ;00 to 00 (Orth) 8 | 0x51023A80,3,1,0x00004b00,1,0=0x51023A80,3,1,0x51020000,1,0 9 | 0x51023A80,3,1,0x00004b00,3,0=0x51023A80,3,1,0x51020000,1,0 10 | 0x51023A80,1,1,0x00004b00,1,0=0x51023A80,1,1,0x51020000,3,0 11 | 0x51023A80,1,1,0x00004b00,3,0=0x51023A80,1,1,0x51020000,3,0 12 | ;00 to 01 (Orth Stub) 13 | ;00 to 04 (Orth-Diag) 14 | ;00 to 08 (90-Bend) 15 | ;----Other Base Crossings---- 16 | ;----Other Network Transitions---- 17 | ;---Orthogonal Transition Hooks--- 18 | ;for full transition code - see TR - Transitions file 19 | 0x51023A80,3,1,0x51000100,3,0=0x51023A80,3,1,0x5102E100,3,0 20 | 0x51023A80,1,1,0x51000100,3,0=0x51023A80,1,1,0x5102E100,1,1 21 | 0x51020000,1,0,0x5700F100,3,0=0x51020000,1,1,0x5102E500,3,0 22 | 0x51020000,1,0,0x5700F100,1,1=0x51020000,1,1,0x5102E500,3,0 23 | ;----Special---- 24 | ;--Roundabouts-- 25 | ;--MRCs-- 26 | ;Small 90 27 | ; 28 | ; 29 | ; 30 | ;--FA-- 31 | ;--FTLs-- 32 | 0x51020000,0,0,0x5B2A0000,1,0=0x5B2A0600,0,1,0x5B2A0000,1,0 33 | 0x51020000,2,0,0x5B2A0000,1,0=0x5B2A0609,0,1,0x5B2A0000,1,0 34 | ;--Slip Lanes-- 35 | ;--SITAP-- 36 | ;--FLEXHeight-- 37 | ;--FLEXOnSlope-- 38 | ;------------------ 39 | ;---END L0 ARD-3--- 40 | ;------------------ -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/Small_90_ARD-3_Add_NWM.txt: -------------------------------------------------------------------------------- 1 | ;Ortho Tile Template 2 | ;------------------------- 3 | ;----L0 ARD-3 (0x5102)---- 4 | ;------------------------- 5 | ;----Base Network---- 6 | ;00 to 00 (Orth) 7 | 0x51324280,3,1,0x00004b00,1,0=0x51324280,3,1,0x51020000,1,0 8 | 0x51324280,3,1,0x00004b00,3,0=0x51324280,3,1,0x51020000,1,0 9 | 0x51324280,1,0,0x00004b00,1,0=0x51324280,1,0,0x51020000,3,0 10 | 0x51324280,1,0,0x00004b00,3,0=0x51324280,1,0,0x51020000,3,0 11 | ;00 to 01 (Orth Stub) 12 | ;00 to 04 (Orth-Diag) 13 | ;00 to 08 (90-Bend) 14 | ;----Other Base Crossings---- 15 | ;----Other Network Transitions---- 16 | ;---Orthogonal Transition Hooks--- 17 | ;for full transition code - see TR - Transitions file 18 | 0x51324280,3,1,0x51000100,3,0=0x51324280,3,1,0x5102E100,3,0 19 | 0x51324280,1,0,0x51000100,3,0=0x51324280,1,0,0x5102E100,1,1 20 | 0x51020000,1,0,0x5700F100,3,0=0x51020000,1,1,0x5102E500,3,0 21 | 0x51020000,1,0,0x5700F100,1,1=0x51020000,1,1,0x5102E500,3,0 22 | ;----Special---- 23 | ;--Roundabouts-- 24 | ;--MRCs-- 25 | ;Small 90 26 | ; 27 | ; 28 | ; 29 | ;--FA-- 30 | ;--FTLs-- 31 | 0x51020000,0,0,0x5B2A0000,1,0=0x5B2A0600,0,1,0x5B2A0000,1,0 32 | 0x51020000,2,0,0x5B2A0000,1,0=0x5B2A0609,0,1,0x5B2A0000,1,0 33 | ;--Slip Lanes-- 34 | ;--SITAP-- 35 | ;--FLEXHeight-- 36 | ;--FLEXOnSlope-- 37 | ;------------------ 38 | ;---END L0 ARD-3--- 39 | ;------------------ 40 | -------------------------------------------------------------------------------- /Controller/RUL2/01_Maxis_Misc/Sec1b_OWR_ARP.txt: -------------------------------------------------------------------------------- 1 | ;------------------------------------------ 2 | ;OneWayRoad Arrows Reduction Plugin; makes some intersections with avenues 3 | ;and this plugin installed work again ;-) 4 | ;added 010108 ~ memo 5 | ;avenue diagonal x onewayroad orthogonal/orthogonal forked transition 6 | 0x5f940300,1,0,0x5F471E00,1,0=0x09004d00,3,0,0x5F471E00,1,0 7 | 0x5f940300,1,0,0x5F471E00,2,0=0x09004d00,1,1,0x5F471E00,2,0 8 | 0x5f940300,3,0,0x5F471E00,1,0=0x09004d00,3,0,0x5F471E00,1,0 9 | 0x5f940300,3,0,0x5F471E00,2,0=0x09004d00,1,1,0x5F471E00,2,0 10 | ;avenue diagonal with curved end into orthogonal onewayroad non-forked transition 11 | 0x5f940300,1,0,0x5F471100,2,0=0x09004d00,1,1,0x5F471100,2,0 12 | 0x5f940300,3,0,0x5F471100,2,0=0x09004d00,1,1,0x5F471100,2,0 13 | 0x5f940300,1,0,0x5F471100,0,1=0x09004d00,3,0,0x5F471100,0,1 14 | 0x5f940300,3,0,0x5F471100,0,1=0x09004d00,3,0,0x5F471100,0,1 15 | ;avenue diagonal x onewayroad orthogonal/diagonal forked transition 16 | 0x5f940300,1,0,0x5F471000,1,0=0x09004d00,3,0,0x5F471000,1,0 17 | 0x5f940300,1,0,0x5F471000,2,0=0x09004d00,1,1,0x5F471000,2,0 18 | 0x5f940300,1,0,0x5F471000,3,1=0x09004d00,1,1,0x5F471000,3,1 19 | 0x5f940300,3,0,0x5F471000,1,0=0x09004d00,3,0,0x5F471000,1,0 20 | 0x5f940300,3,0,0x5F471000,3,1=0x09004d00,1,1,0x5F471000,3,1 21 | ; 22 | ;End OneWayRoad Arrows 23 | ;------------------------------------------ 24 | -------------------------------------------------------------------------------- /src/main/scala/module/GlrRuleGenerator.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import io.github.memo33.metarules.meta._, syntax._ 4 | import Network._, Flags._, Flag._, RotFlip._, Implicits._, group.SymGroup._ 5 | import NetworkProperties._ 6 | 7 | class GlrRuleGenerator(var context: RuleTransducer.Context) extends RuleGenerator with Curve45Generator with CrossingGenerator { 8 | 9 | def start(): Unit = { 10 | for (main <- GlrNetworks; base <- main.base) { 11 | // Rules += main~WE | (base ~> main)~WE // ortho 12 | // Rules += main~WE | (base ~> main)~WC // ortho stub 13 | // Rules += main~SE~ES | (base ~> main)~WN~NW // diagonal 14 | // curves 15 | // createCurve45Rules(main) 16 | // createCurve90Rules(main) 17 | 18 | // crossings (O×O, O×D, D×O, D×D) 19 | for (minor <- CrossingGenerator.crossingNetworksOf(main)) { 20 | createCrossingRules(main, minor) 21 | } 22 | } 23 | } 24 | 25 | } 26 | 27 | // Compile individually with `sbt "runMain com.sc4nam.module.CompileGlrCode"`. 28 | object CompileGlrCode extends AbstractMain { 29 | lazy val resolve: IdResolver = new MiscResolver orElse new RealRailwayResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver 30 | val generator = new GlrRuleGenerator(_) 31 | lazy val file = new java.io.File("target/Sec10e_GlrMetaGenerated_MANAGED.txt") 32 | } 33 | -------------------------------------------------------------------------------- /Controller/RUL2/04_Roundabouts/Sec4b_Road_Roundabouts.txt: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; FLEXible Single Tile Roundabout T to + override - st straight 3 | 0x5F07CF00,0,0,0x05004B00,1,0=0x5F07CE00,0,0,0x05004B00,1,0 4 | 0x5F07CF00,1,0,0x05004B00,2,0=0x5F07CE00,1,0,0x05004B00,2,0 5 | 0x05004B00,0,0,0x5F07CF00,1,0=0x05004B00,0,0,0x5F07CE00,1,0 6 | 0x05004B00,1,0,0x5F07CF00,2,0=0x05004B00,1,0,0x5F07CE00,2,0 7 | ; FLEXible Single st/rd Tile Roundabout T to + override - st stub 8 | 0x5F07CF00,0,0,0x05000300,1,0=0x5F07CE00,0,0,0x05000300,1,0 9 | 0x5F07CF00,1,0,0x05000300,2,0=0x5F07CE00,1,0,0x05000300,2,0 10 | 0x05000300,0,0,0x5F07CF00,1,0=0x05000300,0,0,0x5F07CE00,1,0 11 | 0x05000300,1,0,0x5F07CF00,2,0=0x05000300,1,0,0x5F07CE00,2,0 12 | ; FLEXible Single rd/rd Tile Roundabout T to + override - rd straight 13 | 0x5F07CC00,0,0,0x05004B00,1,0=0x5F07D100,0,0,0x05004B00,1,0 14 | 0x5F07CC00,1,0,0x05004B00,2,0=0x5F07D100,1,0,0x05004B00,2,0 15 | 0x05004B00,0,0,0x5F07CC00,1,0=0x05004B00,0,0,0x5F07D100,1,0 16 | 0x05004B00,1,0,0x5F07CC00,2,0=0x05004B00,1,0,0x5F07D100,2,0 17 | ; FLEXible Single rd/rd Tile Roundabout T to + override - rd stub 18 | 0x5F07CC00,0,0,0x05000300,1,0=0x5F07D100,0,0,0x05000300,1,0 19 | 0x5F07CC00,1,0,0x05000300,2,0=0x5F07D100,1,0,0x05000300,2,0 20 | 0x05000300,0,0,0x5F07CC00,1,0=0x05000300,0,0,0x5F07D100,1,0 21 | 0x05000300,1,0,0x5F07CC00,2,0=0x05000300,1,0,0x5F07D100,2,0 22 | -------------------------------------------------------------------------------- /src/scripts/compile-release-bridge-controller.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script compiles all bridge rul files for inclusion in the installer. 4 | # 5 | # ./src/scripts/compile-release-bridge-controller.sh 6 | # 7 | # The compiled bridge controller is located at `./target/controllers/`. 8 | 9 | set -e 10 | 11 | if [ ! -e "Controller" ] 12 | then 13 | echo "Call this script from the root directory of the Network-Addon-Mod repository." 14 | exit 1 15 | fi 16 | 17 | PROJECT_ROOT="$(pwd)" 18 | TEMP="target/controllers/temp" 19 | mkdir -p "$TEMP" 20 | 21 | BUILDRULS_ARCHIVE="target/BuildRULs_01.zip" 22 | BUILDRULS_URL="https://www.dropbox.com/s/ckwhy11xxaz3z1q/BuildRULs_01.zip?dl=1" 23 | 24 | if [ ! -e "$BUILDRULS_ARCHIVE" ] 25 | then 26 | # download compiler if it does not yet exist 27 | curl -L "$BUILDRULS_URL" > "$BUILDRULS_ARCHIVE" 28 | fi 29 | echo "08816a61cb64c80392328f874c3b5bc031580514c156839af9a8359784a72071 $BUILDRULS_ARCHIVE" | sha256sum --check 30 | unzip -d "$TEMP" "$BUILDRULS_ARCHIVE" 31 | 32 | # build bridge controller 33 | (cd "$TEMP/BuildRULs_01" && java -jar BuildRULs.jar -f "$PROJECT_ROOT/Controller/Bridge Controller/" "$PROJECT_ROOT/Controller/Bridge Controller/") 34 | 35 | # copy to target 36 | DESTDIR="target/controllers/" 37 | mkdir -p "$DESTDIR" 38 | cp -p "$PROJECT_ROOT/Controller/Bridge Controller/NetworkAddonMod_Bridge_Controller.dat" "$DESTDIR" 39 | 40 | rm -rf "$TEMP" 41 | -------------------------------------------------------------------------------- /src/main/scala/module/NwmRuleGenerator.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import io.github.memo33.metarules.meta._, syntax._ 4 | import Network._, Flags._, Flag._, RotFlip._, Implicits._, group.SymGroup._ 5 | import NetworkProperties._ 6 | 7 | class NwmRuleGenerator(var context: RuleTransducer.Context) extends RuleGenerator with Curve45Generator with CrossingGenerator { 8 | 9 | def start(): Unit = { 10 | for (main <- NwmNetworks; base <- main.base) { 11 | Rules += main~WE | (base ~> main)~WE // ortho 12 | Rules += main~WE | (base ~> main)~WC // ortho stub 13 | withSharedDiagonals { 14 | Rules += main~SE~ES | (base ~> main)~WN~NW // diagonal 15 | } 16 | // curves 17 | createCurve45Rules(main) 18 | createCurve90Rules(main) 19 | 20 | // crossings (O×O, O×D, D×O, D×D) 21 | for (minor <- CrossingGenerator.crossingNetworksOf(main)) { 22 | createCrossingRules(main, minor) 23 | } 24 | } 25 | } 26 | 27 | } 28 | 29 | // Compile individually with `sbt "runMain com.sc4nam.module.CompileNwmCode"`. 30 | object CompileNwmCode extends AbstractMain { 31 | lazy val resolve: IdResolver = new MiscResolver orElse new RealRailwayResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver 32 | val generator = new NwmRuleGenerator(_) 33 | lazy val file = new java.io.File("target/NwmMetaGenerated_MANAGED.txt") 34 | } 35 | -------------------------------------------------------------------------------- /Controller/RUL0/4000_RAM/4100_L2STR.txt: -------------------------------------------------------------------------------- 1 | ;RAM Set2 - Elevated Single Track Railroad (El-STR) button 2 | RotationRing = 4100, 14100, 24100, 34100, 44100, 54100, 64100, 74100 ;El-STR Starter Piece Orth;;;move to own icon later 3 | 4 | ;###separator### 5 | 6 | [HighwayIntersectionInfo_0x00004100] 7 | ;Added by Tarkus 09/14/2010. 8 | ;El-STR Starter piece/Transition (Textures by Bighead99) 9 | Piece = 0.0, 0.0, 0, 0, 0x53d1000B 10 | PreviewEffect = preview_ram2_puzzlepiece000 11 | 12 | CellLayout =....... 13 | CellLayout =...Z<.. 14 | CellLayout =...a... 15 | CellLayout =...^... 16 | 17 | CheckType = Z - Rail: 0x02000200 18 | CheckType = a - Rail: 0x02000200 Lightrail: 0x00010100 optional 19 | 20 | ConsLayout =........ 21 | ConsLayout =...+...< 22 | ConsLayout =........ 23 | ConsLayout =...^.... 24 | 25 | AutoTileBase = 0x53d10000 26 | PlaceQueryID = 0x53d10000 27 | Costs = 400 28 | [HighwayIntersectionInfo_0x00014100] 29 | CopyFrom = 0x4100 30 | Rotate = 1 31 | [HighwayIntersectionInfo_0x00024100] 32 | CopyFrom = 0x4100 33 | Rotate = 2 34 | [HighwayIntersectionInfo_0x00034100] 35 | CopyFrom = 0x4100 36 | Rotate = 3 37 | ;rotation clones 38 | [HighwayIntersectionInfo_0x00044100] 39 | CopyFrom = 0x4100 40 | [HighwayIntersectionInfo_0x00054100] 41 | CopyFrom = 0x14100 42 | [HighwayIntersectionInfo_0x00064100] 43 | CopyFrom = 0x24100 44 | [HighwayIntersectionInfo_0x00074100] 45 | CopyFrom = 0x34100 46 | 47 | 48 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/0B_Orth-Diag_Bottom_NWM.txt: -------------------------------------------------------------------------------- 1 | ;Ortho Tile Template 2 | ;------------------------- 3 | ;----L0 ARD-3 (0x5102)---- 4 | ;------------------------- 5 | ;----Base Network---- 6 | ;00 to 00 (Orth) 7 | 0x51020B00,1,0,0x00004b00,1,0=0x51020B00,1,0,0x51020000,1,0 8 | 0x51020B00,1,0,0x00004b00,3,0=0x51020B00,1,0,0x51020000,1,0 9 | 0x51020B00,3,1,0x00004b00,1,0=0x51020B00,3,1,0x51020000,3,0 10 | 0x51020B00,3,1,0x00004b00,3,0=0x51020B00,3,1,0x51020000,3,0 11 | ;00 to 01 (Orth Stub) 12 | ;00 to 04 (Orth-Diag) 13 | ;to 0C (Orth-Diag Top) 14 | 0x51020B00,3,0,0x00000c00,3,1=0x51020B00,3,0,0x51020C00,3,1 15 | 0x51020B00,1,1,0x00000c00,1,0=0x51020B00,1,1,0x51020C00,1,0 16 | ;00 to 08 (90-Bend) 17 | ;----Other Base Crossings---- 18 | ;----Other Network Transitions---- 19 | ;---Orthogonal Transition Hooks--- 20 | ;for full transition code - see TR - Transitions file 21 | 0x51020B00,1,0,0x51000100,3,0=0x51020B00,1,0,0x5102E100,3,0 22 | 0x51020B00,3,1,0x51000100,3,0=0x51020B00,3,1,0x5102E100,1,1 23 | 0x51020000,1,0,0x5700F100,3,0=0x51020000,1,1,0x5102E500,3,0 24 | 0x51020000,1,0,0x5700F100,1,1=0x51020000,1,1,0x5102E500,3,0 25 | ;----Special---- 26 | ;--Roundabouts-- 27 | ;--MRCs-- 28 | ;Small 90 29 | ; 30 | ; 31 | ; 32 | ;--FA-- 33 | ;--FTLs-- 34 | 0x51020000,0,0,0x5B2A0000,1,0=0x5B2A0600,0,1,0x5B2A0000,1,0 35 | 0x51020000,2,0,0x5B2A0000,1,0=0x5B2A0609,0,1,0x5B2A0000,1,0 36 | ;--Slip Lanes-- 37 | ;--SITAP-- 38 | ;--FLEXHeight-- 39 | ;--FLEXOnSlope-- 40 | ;------------------ 41 | ;---END L0 ARD-3--- 42 | ;------------------ -------------------------------------------------------------------------------- /Controller/RUL1/05_Avenue/10_Avenue_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [AvenueGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 115 4 | ; 5 | ;TYPE1=0x04020002,0x04020002,0x04011500,0,0 6 | ;TYPE2=0x00020402,0x00020402,0x04011500,2,0 7 | ;TYPE3=0x02040200,0x02040200,0x04011500,3,0 8 | ;TYPE4=0x02000204,0x02000204,0x04011500,1,0 9 | ; 10 | ;TYPE1=0x04020002,0x04020000,0x04011500,0,0 11 | ;TYPE2=0x00020402,0x00020400,0x04011500,2,0 12 | ;TYPE3=0x02040200,0x02040000,0x04011500,3,0 13 | ;TYPE4=0x02000204,0x02000004,0x04011500,1,0 14 | ;TYPE5=0x04020002,0x04000002,0x04011500,0,0 15 | ;TYPE6=0x00020402,0x00000402,0x04011500,2,0 16 | ;TYPE7=0x02040200,0x00040200,0x04011500,3,0 17 | ;TYPE8=0x02000204,0x00000204,0x04011500,1,0 18 | ; 19 | TYPE1=0x02000004,0x00000204,0x04011500,1,0 20 | TYPE2=0x02040000,0x00040200,0x04011500,1,1 21 | TYPE3=0x00020400,0x00000402,0x04011500,2,1 22 | TYPE4=0x04020000,0x04000002,0x04011500,0,0 23 | TYPE5=0x00000204,0x02000004,0x04011500,3,1 24 | TYPE6=0x00040200,0x02040000,0x04011500,3,0 25 | TYPE7=0x00000402,0x00020400,0x04011500,2,0 26 | TYPE8=0x04000002,0x04020000,0x04011500,0,1 27 | ; 28 | ;for diagonal head to head 29 | ;piece 117 30 | TYPE1=0x00010300,0x03000001,0x04011700,0,0 31 | TYPE2=0x03000001,0x00010300,0x04011700,2,0 32 | TYPE3=0x00000103,0x01030000,0x04011700,3,0 33 | TYPE4=0x01030000,0x00000103,0x04011700,1,0 34 | ; 35 | ; 36 | ;FLEXFLUPs Overcrossing-GMHW 37 | TYPE1=0x04030403,0x02040200,0x06701400,0,0 38 | TYPE2=0x03040304,0x04020002,0x06701400,1,0 39 | TYPE3=0x04030403,0x02000204,0x06701400,2,0 40 | TYPE4=0x03040304,0x00020402,0x06701400,3,0 41 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/05_Avenue/10_Avenue_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [AvenueGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 115 4 | ; 5 | ;TYPE1=0x04020002,0x04020002,0x04011500,0,0 6 | ;TYPE2=0x00020402,0x00020402,0x04011500,2,0 7 | ;TYPE3=0x02040200,0x02040200,0x04011500,3,0 8 | ;TYPE4=0x02000204,0x02000204,0x04011500,1,0 9 | ; 10 | ;TYPE1=0x04020002,0x04020000,0x04011500,0,0 11 | ;TYPE2=0x00020402,0x00020400,0x04011500,2,0 12 | ;TYPE3=0x02040200,0x02040000,0x04011500,3,0 13 | ;TYPE4=0x02000204,0x02000004,0x04011500,1,0 14 | ;TYPE5=0x04020002,0x04000002,0x04011500,0,0 15 | ;TYPE6=0x00020402,0x00000402,0x04011500,2,0 16 | ;TYPE7=0x02040200,0x00040200,0x04011500,3,0 17 | ;TYPE8=0x02000204,0x00000204,0x04011500,1,0 18 | ; 19 | TYPE1=0x02000004,0x00000204,0x04011500,1,0 20 | TYPE2=0x02040000,0x00040200,0x04011500,1,1 21 | TYPE3=0x00020400,0x00000402,0x04011500,2,1 22 | TYPE4=0x04020000,0x04000002,0x04011500,0,0 23 | TYPE5=0x00000204,0x02000004,0x04011500,3,1 24 | TYPE6=0x00040200,0x02040000,0x04011500,3,0 25 | TYPE7=0x00000402,0x00020400,0x04011500,2,0 26 | TYPE8=0x04000002,0x04020000,0x04011500,0,1 27 | ; 28 | ;for diagonal head to head 29 | ;piece 117 30 | TYPE1=0x00010300,0x03000001,0x04011700,0,0 31 | TYPE2=0x03000001,0x00010300,0x04011700,2,0 32 | TYPE3=0x00000103,0x01030000,0x04011700,3,0 33 | TYPE4=0x01030000,0x00000103,0x04011700,1,0 34 | ; 35 | ; 36 | ;FLEXFLUPs Overcrossing-GMHW 37 | TYPE1=0x04030403,0x02040200,0x06701400,0,0 38 | TYPE2=0x03040304,0x04020002,0x06701400,1,0 39 | TYPE3=0x04030403,0x02000204,0x06701400,2,0 40 | TYPE4=0x03040304,0x00020402,0x06701400,3,0 41 | -------------------------------------------------------------------------------- /src/test/scala/localization/GenerateLocalesSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.localization 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | 6 | class GenerateLocalesSpec extends AnyWordSpec with Matchers { 7 | 8 | val poTestCase = raw""" 9 | # comment 10 | msgctxt "context1" 11 | msgid "aaa" 12 | msgstr "AAA" 13 | 14 | #, fuzzy 15 | #| msgctxt "context2" 16 | #| msgid "bbb-old" 17 | msgctxt "context2" 18 | msgid "bbb" 19 | msgstr "BBB-old" 20 | 21 | msgctxt "context3" 22 | msgid "ccc" 23 | msgstr "CCC" 24 | """ 25 | 26 | "workaround for detecting fuzzy translations" should { 27 | "work as expected" in { 28 | // This test ensures that scaposer's parsing of comments has not changed so our workaround keeps working 29 | val translations = scaposer.Parser.parse(poTestCase).toOption.get 30 | // fuzzy flag is read as part of first entry, not second 31 | translations.map(_.asInstanceOf[scaposer.SingularTranslation].otherComments.exists(_.contains("fuzzy"))) shouldBe Seq(true, false, false) 32 | // in particular, ctxComments of second entry are empty 33 | translations.map(_.asInstanceOf[scaposer.SingularTranslation].ctxComments.nonEmpty) shouldBe Seq(true, false, false) 34 | } 35 | } 36 | 37 | "escaping special characters" should { 38 | "work as expected" in { 39 | import GenerateLocales.quote 40 | quote(raw"a &/or b") shouldBe "\"a &/or b\"" 41 | quote(raw"""abç/&\déf\n\r\'äb"cd'_""") shouldBe raw""""abç/&\\déf\\n\\r\\'äb\"cd'_"""" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/T00A_Street_ThruT_OxO.txt: -------------------------------------------------------------------------------- 1 | ;==Orthogonal Tile and Adjacencies (10)== 2 | ;------------------------- 3 | ;----L0 RHW-2 (0x5700)---- 4 | ;------------------------- 5 | ;covered by INRULs and Specials 6 | ;------------------ 7 | ;---END L0 RHW-2--- 8 | ;------------------ 9 | ;------------------------- 10 | ;----L0 RHW-3 (0x5701)---- 11 | ;------------------------- 12 | ;----Base Network---- 13 | ;00 to 00 (Orth) 14 | 0x57610000,1,0,0x57000000,1,0=0x57610000,1,0,0x57010000,1,0 15 | 0x57610000,1,0,0x57000000,3,0=0x57610000,1,0,0x57010000,1,0 16 | 0x57610000,3,0,0x57000000,1,0=0x57610000,3,0,0x57010000,3,0 17 | 0x57610000,3,0,0x57000000,3,0=0x57610000,3,0,0x57010000,3,0 18 | ;---END L0 RHW-3--- 19 | ;------------------ 20 | ;----------------------- 21 | ;----L0 MIS (0x5702)---- 22 | ;----------------------- 23 | ;----Base Network---- 24 | ;00 to 00 (Orth) 25 | 0x57620000,1,0,0x57000000,1,0=0x57620000,1,0,0x57020000,1,0 26 | 0x57620000,1,0,0x57000000,3,0=0x57620000,1,0,0x57020000,1,0 27 | 0x57620000,3,0,0x57000000,1,0=0x57620000,3,0,0x57020000,3,0 28 | 0x57620000,3,0,0x57000000,3,0=0x57620000,3,0,0x57020000,3,0 29 | ;----END L0 MIS---- 30 | ;------------------ 31 | ;------------------------- 32 | ;----L0 RHW-4 (0x5703)---- 33 | ;------------------------- 34 | ;----Base Network---- 35 | ;00 to 00 (Orth) 36 | 0x57630000,1,0,0x57000000,1,0=0x57630000,1,0,0x57030000,1,0 37 | 0x57630000,1,0,0x57000000,3,0=0x57630000,1,0,0x57030000,1,0 38 | 0x57630000,3,0,0x57000000,1,0=0x57630000,3,0,0x57030000,3,0 39 | 0x57630000,3,0,0x57000000,3,0=0x57630000,3,0,0x57030000,3,0 40 | ;---END L0 RHW-4--- 41 | ;------------------ -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/T00B_Street_ThruT_OxO.txt: -------------------------------------------------------------------------------- 1 | ;==Orthogonal Tile and Adjacencies (10)== 2 | ;------------------------- 3 | ;----L0 RHW-2 (0x5700)---- 4 | ;------------------------- 5 | ;covered by INRULs and Specials 6 | ;------------------ 7 | ;---END L0 RHW-2--- 8 | ;------------------ 9 | ;------------------------- 10 | ;----L0 RHW-3 (0x5701)---- 11 | ;------------------------- 12 | ;----Base Network---- 13 | ;00 to 00 (Orth) 14 | 0x57610080,3,0,0x57000000,1,0=0x57610080,3,0,0x57010000,1,0 15 | 0x57610080,3,0,0x57000000,3,0=0x57610080,3,0,0x57010000,1,0 16 | 0x57610080,1,0,0x57000000,1,0=0x57610080,1,0,0x57010000,3,0 17 | 0x57610080,1,0,0x57000000,3,0=0x57610080,1,0,0x57010000,3,0 18 | ;---END L0 RHW-3--- 19 | ;------------------ 20 | ;----------------------- 21 | ;----L0 MIS (0x5702)---- 22 | ;----------------------- 23 | ;----Base Network---- 24 | ;00 to 00 (Orth) 25 | 0x57620080,3,0,0x57000000,1,0=0x57620080,3,0,0x57020000,1,0 26 | 0x57620080,3,0,0x57000000,3,0=0x57620080,3,0,0x57020000,1,0 27 | 0x57620080,1,0,0x57000000,1,0=0x57620080,1,0,0x57020000,3,0 28 | 0x57620080,1,0,0x57000000,3,0=0x57620080,1,0,0x57020000,3,0 29 | ;----END L0 MIS---- 30 | ;------------------ 31 | ;------------------------- 32 | ;----L0 RHW-4 (0x5703)---- 33 | ;------------------------- 34 | ;----Base Network---- 35 | ;00 to 00 (Orth) 36 | 0x57630080,3,0,0x57000000,1,0=0x57630080,3,0,0x57030000,1,0 37 | 0x57630080,3,0,0x57000000,3,0=0x57630080,3,0,0x57030000,1,0 38 | 0x57630080,1,0,0x57000000,1,0=0x57630080,1,0,0x57030000,3,0 39 | 0x57630080,1,0,0x57000000,3,0=0x57630080,1,0,0x57030000,3,0 40 | ;---END L0 RHW-4--- 41 | ;------------------ -------------------------------------------------------------------------------- /src/scripts/syntax-check-rul2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script checks all the RUL2 files for syntax errors. 4 | # If any are found, they are printed to stdout and the script exits with a non-zero return code. 5 | set -e 6 | 7 | INDIR="./Controller" 8 | OUT="./syntax-check-rul2.log" 9 | 10 | sorted_input_files() { 11 | find -L "$INDIR/$1" -type f \( -name '*.txt' -o -name '*.rul' -o -name '*.ini' \) -print0 | sort -z 12 | } 13 | 14 | strip_drive_side() { 15 | # Uncomments the RHD _and_ LHD code. 16 | # If an argument is passed, this uses xargs to read file names from stdin, 17 | # else stdin is read as input directly. 18 | ${1:+ xargs -0} sed -e "s/;###[RL]HD###//" 19 | } 20 | # Note that we used sed and tail for concatenation which handle missing 21 | # newlines at the end of input files gracefully (unlike cat). 22 | 23 | strip_comments_and_whitespace() { 24 | sed -e "s/;.*//" -e "s/\s\+//g" -e '/^\s*$/d' 25 | } 26 | 27 | strip_valid_rul2() { 28 | # matches RUL2 code as well as prevents 29 | IDROTFLIP="0[xX][[:xdigit:]]\{4,8\},[0-3],[01]" 30 | sed -e "/^$IDROTFLIP,$IDROTFLIP=\($IDROTFLIP,$IDROTFLIP\|0,0,0,0,0,0\)$/d" 31 | } 32 | 33 | echo "Checking RUL2 syntax..." 34 | 35 | # The `tail -n +2` skips the first line, containing `[RuleOverrides]`. 36 | sorted_input_files "RUL2" | strip_drive_side -0 | strip_comments_and_whitespace | strip_valid_rul2 | tail -n +2 > "$OUT" 37 | 38 | if [ -s "$OUT" ]; then 39 | # the log file is not-empty 40 | echo "Syntax errors in RUL2:" 41 | cat "$OUT" 42 | rm -f "$OUT" 43 | exit 1 44 | else 45 | echo "No syntax errors found." 46 | rm -f "$OUT" 47 | exit 0 48 | fi 49 | -------------------------------------------------------------------------------- /src/scripts/remove-rhw-adjacencies.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # A one-time script for removing manually written adjacency code for RHW which becomes redundant with the DLL. 4 | 5 | import os 6 | from enum import Enum 7 | 8 | class State(Enum): 9 | INIT = 0 10 | BASEOVERRIDE = 1 11 | ADJACENCY = 2 12 | SECTIONENDED = 3 13 | 14 | for parent, dirs, files in os.walk("Controller/RUL2/07_RHW/Sec7b_BaseNetwork"): 15 | for fname in files: 16 | if fname in ["00_Orthogonal.txt", "02_Diagonal.txt"]: 17 | continue # base orthogonals and diagonals must be kept 18 | 19 | p = os.path.join(parent, fname) 20 | p_tmp = os.path.join(parent, f"{fname}.tmp") 21 | state = State.INIT 22 | 23 | with open(p, encoding='utf-8') as file: 24 | with open (p_tmp, 'w', encoding='utf-8') as file_tmp: 25 | 26 | for line in file: 27 | if line.startswith(";00 to 00") or line.startswith(";02 to 02"): 28 | state = State.BASEOVERRIDE 29 | elif "---END" in line: 30 | state = State.SECTIONENDED 31 | elif state == State.BASEOVERRIDE and (line.startswith(";00 to ") or line.startswith(";02 to ")): 32 | state = State.ADJACENCY 33 | else: 34 | pass 35 | 36 | if state != State.ADJACENCY: 37 | file_tmp.write(line) 38 | 39 | if state == State.INIT: 40 | os.remove(p_tmp) 41 | else: 42 | os.replace(p_tmp, p) 43 | if state != State.SECTIONENDED: 44 | print(f"Terminated with unexpected state in file {fname}") 45 | -------------------------------------------------------------------------------- /Controller/RUL1/08_OneWayRoad/10_OneWayRoad_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [OneWayRoadGroundHighwayIntersectionSolutions] 2 | ; Added 05/07/04 ~ Tropod 3 | ;piece 115 4 | ; One-way head on to GroundHighway transition 5 | TYPE1=0x02000000,0x00000204,0x04011500,1,0 6 | TYPE2=0x02000000,0x00040200,0x04011500,1,1 7 | TYPE3=0x00020000,0x00000402,0x04011500,2,1 8 | TYPE4=0x00020000,0x04000002,0x04011500,0,0 9 | TYPE5=0x00000200,0x02000004,0x04011500,3,1 10 | TYPE6=0x00000200,0x02040000,0x04011500,3,0 11 | TYPE7=0x00000002,0x00020400,0x04011500,2,0 12 | TYPE8=0x00000002,0x04020000,0x04011500,0,1 13 | ;additional combo added 05.22.05 ~ Tropod 14 | ;helper for onewayroad head onto groundhighway puzzle piece 15 | ;TYPE1=0x02000000,0x00000200,0x04011500,1,0 16 | ;TYPE2=0x02000000,0x00000200,0x04011500,1,1 17 | ;TYPE3=0x00020000,0x00000002,0x04011500,2,1 18 | ;TYPE4=0x00020000,0x00000002,0x04011500,0,0 19 | ;TYPE5=0x00000200,0x02000000,0x04011500,3,1 20 | ;TYPE6=0x00000200,0x02000000,0x04011500,3,0 21 | ;TYPE7=0x00000002,0x00020000,0x04011500,2,0 22 | ;TYPE8=0x00000002,0x00020000,0x04011500,0,1 23 | ; 24 | ;Added by Tropod 07.17.04 25 | ;piece 117 26 | ; diagonal head to head 27 | ;See RuleOverrides RUL 28 | TYPE1=0x00010300,0x03000001,0x04011700,0,0 29 | TYPE1A=0x00000300,0x03000001,0x04011700,0,0 30 | TYPE1B=0x00010000,0x03000001,0x04011700,0,0 31 | TYPE2=0x03000001,0x00010300,0x04011700,2,0 32 | TYPE2A=0x00000001,0x00010300,0x04011700,2,0 33 | TYPE2B=0x03000000,0x00010300,0x04011700,2,0 34 | TYPE3=0x00000103,0x01030000,0x04011700,3,0 35 | TYPE3A=0x00000003,0x01030000,0x04011700,3,0 36 | TYPE3B=0x00000100,0x01030000,0x04011700,3,0 37 | TYPE4=0x01030000,0x00000103,0x04011700,1,0 38 | TYPE4A=0x00030000,0x00000103,0x04011700,1,0 39 | TYPE4B=0x01000000,0x00000103,0x04011700,1,0 40 | ; 41 | 42 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/08_OneWayRoad/10_OneWayRoad_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [OneWayRoadGroundHighwayIntersectionSolutions] 2 | ; Added 05/07/04 ~ Tropod 3 | ;piece 115 4 | ; One-way head on to GroundHighway transition 5 | TYPE1=0x02000000,0x00000204,0x04011500,1,0 6 | TYPE2=0x02000000,0x00040200,0x04011500,1,1 7 | TYPE3=0x00020000,0x00000402,0x04011500,2,1 8 | TYPE4=0x00020000,0x04000002,0x04011500,0,0 9 | TYPE5=0x00000200,0x02000004,0x04011500,3,1 10 | TYPE6=0x00000200,0x02040000,0x04011500,3,0 11 | TYPE7=0x00000002,0x00020400,0x04011500,2,0 12 | TYPE8=0x00000002,0x04020000,0x04011500,0,1 13 | ;additional combo added 05.22.05 ~ Tropod 14 | ;helper for onewayroad head onto groundhighway puzzle piece 15 | ;TYPE1=0x02000000,0x00000200,0x04011500,1,0 16 | ;TYPE2=0x02000000,0x00000200,0x04011500,1,1 17 | ;TYPE3=0x00020000,0x00000002,0x04011500,2,1 18 | ;TYPE4=0x00020000,0x00000002,0x04011500,0,0 19 | ;TYPE5=0x00000200,0x02000000,0x04011500,3,1 20 | ;TYPE6=0x00000200,0x02000000,0x04011500,3,0 21 | ;TYPE7=0x00000002,0x00020000,0x04011500,2,0 22 | ;TYPE8=0x00000002,0x00020000,0x04011500,0,1 23 | ; 24 | ;Added by Tropod 07.17.04 25 | ;piece 117 26 | ; diagonal head to head 27 | ;See RuleOverrides RUL 28 | TYPE1=0x00010300,0x03000001,0x04011700,0,0 29 | TYPE1A=0x00000300,0x03000001,0x04011700,0,0 30 | TYPE1B=0x00010000,0x03000001,0x04011700,0,0 31 | TYPE2=0x03000001,0x00010300,0x04011700,2,0 32 | TYPE2A=0x00000001,0x00010300,0x04011700,2,0 33 | TYPE2B=0x03000000,0x00010300,0x04011700,2,0 34 | TYPE3=0x00000103,0x01030000,0x04011700,3,0 35 | TYPE3A=0x00000003,0x01030000,0x04011700,3,0 36 | TYPE3B=0x00000100,0x01030000,0x04011700,3,0 37 | TYPE4=0x01030000,0x00000103,0x04011700,1,0 38 | TYPE4A=0x00030000,0x00000103,0x04011700,1,0 39 | TYPE4B=0x01000000,0x00000103,0x04011700,1,0 40 | ; 41 | 42 | -------------------------------------------------------------------------------- /src/test/scala/pathing/nwmpaths/PathCreatorSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.pathing.nwmpaths 2 | 3 | import scala.collection.immutable.StringOps 4 | import org.scalatest.wordspec.AnyWordSpec 5 | import org.scalatest.matchers.should.Matchers 6 | import io.github.memo33.metarules.pathing._, Bezier._ 7 | import io.github.memo33.scdbpf._, Sc4Path._, DbpfUtil.RotFlip._ 8 | import com.sc4nam.module.syntax._, Network._, io.github.memo33.metarules.meta.Flags._ 9 | import PathCreator._ 10 | import Trimming.trimToTile 11 | import NetworkConfig._ 12 | 13 | class PathCreatorSpec extends AnyWordSpec with Matchers { 14 | 15 | // yields input for plotting with SAGE 16 | def show(pss: Seq[(Seq[Point],String)]): String = pss.map { case (ps, col) => listPlot(ps, col) } .mkString("show(", "+", ",aspect_ratio=1)") 17 | private def pyList(ps: Seq[Point]): String = ps.map(c => s"(${c.x},${c.y})").mkString("[", ",", "]") 18 | private def listPlot(ps: Seq[Point], col: String): String = s"list_plot(${pyList(ps)},plotjoined=True,color='$col',marker='.')" 19 | 20 | def pathToPoints(path: Sc4Path): Seq[(Points,String)] = path.paths map (p => (p.coords map coordToPoint, if (p.transportType == TransportType.Sim) "red" else "blue")) 21 | def printInColumns(n: Int, text: String) = { 22 | val lines = text.linesIterator.toSeq 23 | val blockSize = (lines.length + n - 1) / n 24 | for (tokens <- lines.padTo(blockSize * n, "").grouped(blockSize).toSeq.transpose) { 25 | println(tokens.map(_.padTo(40,' ')).mkString("")) 26 | } 27 | } 28 | def display(path: Sc4Path) = { 29 | printInColumns(5, path.toString) 30 | println(s"\n${show(pathToPoints(path))}\n") 31 | } 32 | 33 | val sc4p = new PlusIntersection(Ard3~NS, Ard3~WE).buildSc4Path 34 | display(sc4p) 35 | } 36 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/TLA-9-AVE-8-Temp.txt: -------------------------------------------------------------------------------- 1 | ;----Base Network---- 2 | ;00 to 00 (Orth) 3 | 0x51210000,1,0,0x09004b00,1,0=0x51210000,1,0,0x51210000,1,0 4 | 0x51210000,1,0,0x09004b00,3,0=0x51210000,1,0,0x51210000,1,0 5 | 0x51210000,3,0,0x09004b00,1,0=0x51210000,3,0,0x51210000,3,0 6 | 0x51210000,3,0,0x09004b00,3,0=0x51210000,3,0,0x51210000,3,0 7 | ;00 to 01 (Orth Stub) 8 | 0x51210000,1,0,0x09000300,1,0=0x51210000,1,0,0x51210100,1,0 9 | 0x51210000,3,0,0x09000300,1,0=0x51210000,3,0,0x51210100,3,1 10 | ;00 to 05/06 (Orth-Diag Bottom) 11 | 0x51210000,3,0,0x09004d00,1,1=0x51210000,3,0,0x51210000,3,0 12 | 0x51210000,1,0,0x09004d00,3,0=0x51210000,1,0,0x51210000,1,0 13 | 0x51210000,1,0,0x09004d00,1,1=0x51210500,1,0,0x51210600,1,0 14 | 0x51210000,3,0,0x09004d00,3,0=0x51210500,3,1,0x51210600,3,1 15 | 16 | 17 | 18 | 19 | ;----Other Base Crossings---- 20 | 21 | ;----Other Network Transitions---- 22 | ;---Orthogonal Transition Hooks--- 23 | ;for full transition code - see TR - Transitions file 24 | 0x51210000,1,0,0x5700F100,3,0=0x51210000,1,0,0x5121E200,1,0; missing_paths 25 | 0x51210000,1,0,0x5700F100,1,1=0x51210000,1,0,0x5121E200,1,0; missing_paths 26 | 0x51210000,3,0,0x5700F100,3,0=0x51210000,3,0,0x5121E200,3,1; missing_paths 27 | 0x51210000,3,0,0x5700F100,1,1=0x51210000,3,0,0x5121E200,3,1; missing_paths 28 | 0x51210000,1,0,0x5F045B00,1,0=0x51210000,1,0,0x5121E309,1,1; missing_paths 29 | 0x51210000,3,0,0x5F045B00,1,0=0x51210000,3,0,0x5121E309,3,0; missing_paths 30 | 31 | ;----Special---- 32 | ;--Roundabouts-- 33 | ;----Road---- 34 | ;----One-Way Road---- 35 | 36 | ;--MRCs-- 37 | ;R1 38 | ;R2 39 | ;R3 40 | ;R4 41 | ;R5 42 | ;S1 43 | ;S-Reg covered by FA-2 44 | 45 | ;--FA-- 46 | 47 | ;--FTLs-- 48 | 49 | ;--Slip Lanes-- 50 | 51 | ;--SITAP-- 52 | 53 | ;--FLEXHeight-- 54 | 55 | ;--FLEXOnSlope-- -------------------------------------------------------------------------------- /Controller/RUL0/F000_Special/FF00_DummyButton.txt: -------------------------------------------------------------------------------- 1 | ;Dummy Menu button for testing/experimenting 2 | ;Dummy Menu button for testing/experimenting 3 | RotationRing = FF00, 1FF00, 2FF00, 3FF00 ; 4 | 5 | 6 | ;###separator### 7 | 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 19 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 20 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 21 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 23 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 24 | ;TESTING &/or IMPLEMENTING SECTION 25 | ;TESTING &/or IMPLEMENTING SECTION 26 | ;TESTING &/or IMPLEMENTING SECTION 27 | ; 28 | ;Before using an ID, series of IDs, addtypes values, effect directory preview name(s)/value(s), just check to make sure they're not already in use, otherwise conflicts may arise. 29 | ; 30 | 31 | -------------------------------------------------------------------------------- /src/test/scala/module/ResolverBuilderSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | import io.github.memo33.metarules.meta._ 6 | import syntax._, Implicits._, RotFlip._, Network._, Flags._, NetworkProperties._ 7 | 8 | class ResolverBuilderSpec extends AnyWordSpec with Matchers { 9 | 10 | "ResolverBuilder" should { 11 | "handle mirror variants as expected" in { 12 | val builder = new ResolverBuilder() 13 | builder.addOne((Road~NS).projectLeft & Rail~NE, IdTile(0x03010200, R0F0, nonMirroredOnly)) 14 | builder.addOne((Road~NS).projectRight & Rail~NE, IdTile(0x03020500, R0F0, mirroredOnly)) 15 | builder.addOne((Road~WN).projectLeft & Rail~NS, IdTile(0x03020100, R0F0, nonMirroredOnly)) 16 | builder.addOne((Road~WN).projectRight & Rail~NS, IdTile(0x03020400, R0F0, mirroredOnly)) 17 | builder.addOne((Road~ES).projectLeft & Rail~NE, IdTile(0x03020200, R0F0, nonMirroredOnly)) 18 | builder.addOne((Road~NW).projectRight & Rail~NE, IdTile(0x03020300, R0F0, nonMirroredOnly)) 19 | 20 | val m = builder.result() 21 | val resolve = new MiscResolver 22 | m.foreach { case (tile, idTile) => 23 | val resolved = resolve(tile) 24 | (tile, idTile, idTile.mappedRepr(tile.representations)) shouldBe (tile, resolved, resolved.mappedRepr(tile.representations)) 25 | } 26 | } 27 | "show correctly trimmed stack trace for duplicate IDs" in { 28 | val builder = new ResolverBuilder() 29 | builder.add(Road~(0,0,0,0), 0x00000100) 30 | val thrown = intercept[ResolverBuilder.DuplicateId] { 31 | builder.add(Road~(0,0,0,0), 0x00000100) 32 | } 33 | thrown.getStackTrace.head.getFileName.shouldBe("ResolverBuilderSpec.scala") 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Controller/Bridge Controller/RULConfig.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Syntax: 3 | # 4 | # Lines starting with # are interpreted as comments. 5 | # 6 | # 'File' denotes the name of the target file. The path is interpreted 7 | # relative to the location of the RULConfig.txt file. 8 | # 9 | # 'TGI' and 'Compressed' are self-explanatory. 10 | # 11 | # 'Source' specifies the source that is used to build a RUL file. 12 | # If multiple source files are specified, these will be concatenated 13 | # preserving their order. Note that the source files must explicitly 14 | # end with a newline in this case, unless the next file starts with 15 | # a comment anyway. Paths are interpreted relative to the source 16 | # directory passed to the BuildRULs utility. 17 | # 18 | # -memo 19 | # 20 | ############################################################# 21 | 22 | File: NetworkAddonMod_Bridge_Controller.dat 23 | 24 | # Road 25 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001000 26 | Compressed: 1 27 | Source: 00001000.rul 28 | 29 | # Rail 30 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001001 31 | Compressed: 1 32 | Source: 00001001.rul 33 | 34 | # Street 35 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001003 36 | Compressed: 1 37 | Source: 00001003.rul 38 | 39 | # Avenue 40 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001006 41 | Compressed: 1 42 | Source: 00001006.rul 43 | 44 | # Light Rail 45 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001008 46 | Compressed: 1 47 | Source: 00001008.rul 48 | 49 | # Monorail 50 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001009 51 | Compressed: 1 52 | Source: 00001009.rul 53 | 54 | # One Way Road 55 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100A 56 | Compressed: 1 57 | Source: 0000100a.rul 58 | 59 | # Dirt Road 60 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100B 61 | Compressed: 1 62 | Source: 0000100b.rul 63 | 64 | # Ground Highway 65 | TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100C 66 | Compressed: 1 67 | Source: 0000100c.rul 68 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7i_FLEXRamp/Sec7ic_FLEXRamp_QuickChange_LHD.txt: -------------------------------------------------------------------------------- 1 | ;-----Preliminary QuickChange Code----- 2 | ;----Orthogonal Type A1 Ramp + QuickChange---- 3 | ;--Override Elevated MIS through Curved HT-- 4 | 0x57020000,1,0,0x57729050,0,0=0x57120000,1,0,0x57729050,0,0 5 | 0x57020000,3,0,0x57729050,2,1=0x57120000,3,0,0x57729050,2,1 6 | ;--Main Override, Override through Branch-- 7 | ;03-01, OTB, L1 8 | 0x57800399,1,0,0x57800180,1,0=0x57800399,1,0,0x57800199,1,0 9 | 0x57800319,3,1,0x57800100,3,1=0x57800319,3,1,0x57800119,3,1 10 | ;01-02, OTB, L1 11 | 0x57800199,0,0,0x57800280,0,0=0x57800199,0,0,0x57800299,0,0 12 | 0x57800119,2,1,0x57800200,2,1=0x57800119,2,1,0x57800219,2,1 13 | ;03-01, OTB, L2 14 | 0x578003A9,1,0,0x57800180,1,0=0x578003A9,1,0,0x578001A9,1,0 15 | 0x57800329,3,1,0x57800100,3,1=0x57800329,3,1,0x57800129,3,1 16 | ;01-02, OTB, L2 17 | 0x578001A9,0,0,0x57800280,0,0=0x578001A9,0,0,0x578002A9,0,0 18 | 0x57800129,2,1,0x57800200,2,1=0x57800129,2,1,0x57800229,2,1 19 | ;--OTB with Elevated MIS-- 20 | ;OTB, to 03, L1 21 | 0x57800380,3,0,0x57120000,3,0=0x57800399,3,0,0x57120000,3,0 22 | 0x57800300,1,1,0x57120000,1,0=0x57800319,1,1,0x57120000,1,0 23 | ;OTB, to 03, L2 24 | ;0x57800380,3,0,0x57220000,3,0=0x578003A9,3,0,0x57220000,3,0 25 | ;0x57800300,1,1,0x57220000,1,0=0x57800329,1,1,0x57220000,1,0 26 | ;--OTB with FLEX-HT-- 27 | ;OTB, to 03, L1 28 | 0x57800380,3,0,0x57700200,3,0=0x57800399,3,0,0x57722200,3,0 29 | 0x57800300,1,1,0x57700200,3,0=0x57800319,1,1,0x57722200,1,1 30 | ;Stabilise 31 | ;OTB, to 03, L2 (disabled - unnecessary auto L2) 32 | ;0x57800380,3,0,0x57700300,3,0=0x578003A9,3,0,0x57722300,3,0 33 | ;0x57800300,1,1,0x57700300,3,0=0x57800329,1,1,0x57722300,1,1 34 | ;Stabilise 35 | ;0x57800380,3,0,0x57722300,3,0=0x578003A9,3,0,0x57722300,3,0 36 | ;0x57800300,1,1,0x57722300,1,1=0x57800329,1,1,0x57722300,1,1 37 | ;-----End Preliminary QuickChange Code----- -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7i_FLEXRamp/Sec7ic_FLEXRamp_QuickChange_RHD.txt: -------------------------------------------------------------------------------- 1 | ;-----Preliminary QuickChange Code----- 2 | ;----Orthogonal Type A1 Ramp + QuickChange---- 3 | ;--Override Elevated MIS through Curved HT-- 4 | 0x57020000,1,0,0x57729050,0,0=0x57120000,1,0,0x57729050,0,0 5 | 0x57020000,3,0,0x57729050,2,1=0x57120000,3,0,0x57729050,2,1 6 | ;--Main Override, Override through Branch-- 7 | ;03-01, OTB, L1 8 | 0x57800319,1,0,0x57800100,1,0=0x57800319,1,0,0x57800119,1,0 9 | 0x57800399,3,1,0x57800180,3,1=0x57800399,3,1,0x57800199,3,1 10 | ;01-02, OTB, L1 11 | 0x57800119,0,0,0x57800200,0,0=0x57800119,0,0,0x57800219,0,0 12 | 0x57800199,2,1,0x57800280,2,1=0x57800199,2,1,0x57800299,2,1 13 | ;03-01, OTB, L2 14 | 0x57800329,1,0,0x57800100,1,0=0x57800329,1,0,0x57800129,1,0 15 | 0x578003a9,3,1,0x57800180,3,1=0x578003a9,3,1,0x578001a9,3,1 16 | ;01-02, OTB, L2 17 | 0x57800129,0,0,0x57800200,0,0=0x57800129,0,0,0x57800229,0,0 18 | 0x578001a9,2,1,0x57800280,2,1=0x578001a9,2,1,0x578002a9,2,1 19 | ;--OTB with Elevated MIS-- 20 | ;OTB, to 03, L1 21 | 0x57800300,3,0,0x57120000,3,0=0x57800319,3,0,0x57120000,3,0 22 | 0x57800380,1,1,0x57120000,1,0=0x57800399,1,1,0x57120000,1,0 23 | ;OTB, to 03, L2 24 | ;0x57800300,3,0,0x57220000,3,0=0x57800329,3,0,0x57220000,3,0 25 | ;0x57800380,1,1,0x57220000,1,0=0x578003a9,1,1,0x57220000,1,0 26 | ;--OTB with FLEX-HT-- 27 | ;OTB, to 03, L1 28 | 0x57800300,3,0,0x57700200,3,0=0x57800319,3,0,0x57722200,3,0 29 | 0x57800380,1,1,0x57700200,3,0=0x57800399,1,1,0x57722200,1,1 30 | ;Stabilise 31 | ;OTB, to 03, L2 (disabled - unnecessary auto L2) 32 | ;0x57800300,3,0,0x57700300,3,0=0x57800329,3,0,0x57722300,3,0 33 | ;0x57800380,1,1,0x57700300,3,0=0x578003a9,1,1,0x57722300,1,1 34 | ;Stabilise 35 | ;0x57800300,3,0,0x57722300,3,0=0x57800329,3,0,0x57722300,3,0 36 | ;0x57800380,1,1,0x57722300,1,1=0x578003a9,1,1,0x57722300,1,1 37 | ;-----End Preliminary QuickChange Code----- -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/F3_MHW_Ortho_Transition.txt: -------------------------------------------------------------------------------- 1 | ;==Maxis Highway Ortho Transition (F3)== 2 | ;------------------------- 3 | ;----L0 RHW-2 (0x5700)---- 4 | ;------------------------- 5 | ;covered by INRULs and Specials 6 | ;------------------ 7 | ;---END L0 RHW-2--- 8 | ;------------------ 9 | 10 | ;------------------------- 11 | ;----L0 RHW-4 (0x5703)---- 12 | ;------------------------- 13 | 14 | ;----Base Network---- 15 | ;00 to 00 (Orth) 16 | 0x5703F300,0,0,0x57000000,1,0=0x5703F300,0,0,0x57030000,1,0 17 | 0x5703F300,0,0,0x57000000,3,0=0x5703F300,0,0,0x57030000,1,0 18 | 0x5703F300,2,1,0x57000000,1,0=0x5703F300,2,1,0x57030000,3,0 19 | 0x5703F300,2,1,0x57000000,3,0=0x5703F300,2,1,0x57030000,3,0 20 | ;Bridge Fix 21 | 0x5703F300,0,0,0x57000000,1,1=0x5703F300,0,0,0x57030000,1,0; conflicting-override 22 | 0x5703F300,0,0,0x57000000,3,1=0x5703F300,0,0,0x57030000,1,0; conflicting-override 23 | 0x5703F300,2,1,0x57000000,1,1=0x5703F300,2,1,0x57030000,3,0; conflicting-override 24 | 0x5703F300,2,1,0x57000000,3,1=0x5703F300,2,1,0x57030000,3,0; conflicting-override 25 | ;---END L0 RHW-4--- 26 | ;------------------ 27 | 28 | 29 | ;------------------------- 30 | ;----L2 RHW-4 (0x5723)---- 31 | ;------------------------- 32 | ;----Base Network---- 33 | ;00 to 00 (Orth) 34 | 0x5723F300,0,0,0x57000000,1,0=0x5723F300,0,0,0x57230000,1,0 35 | 0x5723F300,0,0,0x57000000,3,0=0x5723F300,0,0,0x57230000,1,0 36 | 0x5723F300,2,1,0x57000000,1,0=0x5723F300,2,1,0x57230000,3,0 37 | 0x5723F300,2,1,0x57000000,3,0=0x5723F300,2,1,0x57230000,3,0 38 | ;Mirror Fix 39 | 0x5723F300,0,0,0x57000000,1,1=0x5723F300,0,0,0x57230000,1,0; conflicting-override 40 | 0x5723F300,0,0,0x57000000,3,1=0x5723F300,0,0,0x57230000,1,0; conflicting-override 41 | 0x5723F300,2,1,0x57000000,1,1=0x5723F300,2,1,0x57230000,3,0; conflicting-override 42 | 0x5723F300,2,1,0x57000000,3,1=0x5723F300,2,1,0x57230000,3,0; conflicting-override 43 | ;---END L2 RHW-4--- 44 | ;------------------ -------------------------------------------------------------------------------- /Controller/RUL2/13_DualNetworking/Sec13g_RailDualNetworking_Asymmetrical.txt: -------------------------------------------------------------------------------- 1 | ;########################################################## 2 | ;========================================================== 3 | ;====== DualNetworking Rail = + = MonoRail Section ======== 4 | ;======================(Asymmetrical)====================== 5 | ; 6 | ;<_Base-Orthogonal 7 | 0x5db40000,1,0,0x5da40000,1,0=0x5db40000,1,0,0x5db40000,1,0 8 | 0x5db40000,1,0,0x5da40000,3,0=0x5db40000,1,0,0x5db40000,1,0 9 | 0x5db40000,3,0,0x5da40000,1,0=0x5db40000,3,0,0x5db40000,3,0 10 | 0x5db40000,3,0,0x5da40000,3,0=0x5db40000,3,0,0x5db40000,3,0 11 | 0x5db40000,1,0,0x5da40200,1,0=0x5db40000,1,0,0x5db40000,1,0 12 | 0x5db40000,3,0,0x5da40200,1,0=0x5db40000,3,0,0x5db40000,3,0 13 | ; 14 | ;<_D1-End 15 | ; 16 | 0x5da33900,0,0,0x5da40000,1,0=0x5da33900,0,0,0x5db40000,1,0 17 | 0x5da33900,0,0,0x5da40000,3,0=0x5da33900,0,0,0x5db40000,1,0 18 | 0x5da33900,2,1,0x5da40000,1,0=0x5da33900,2,1,0x5db40000,3,0 19 | 0x5da33900,2,1,0x5da40000,3,0=0x5da33900,2,1,0x5db40000,3,0 20 | 0x5da33900,0,0,0x5da40200,1,0=0x5da33900,0,0,0x5db40000,1,0 21 | 0x5da33900,2,1,0x5da40200,1,0=0x5da33900,2,1,0x5db40000,3,0 22 | ; 23 | ;<_D2-End-(1) 24 | ; 25 | 0x5db0b000,2,0,0x5da40000,1,0=0x5db0b000,2,0,0x5db40000,3,0 26 | 0x5db0b000,0,1,0x5da40000,1,0=0x5db0b000,0,1,0x5db40000,1,0 27 | 0x5db0b000,2,0,0x5da40000,3,0=0x5db0b000,2,0,0x5db40000,3,0 28 | 0x5db0b000,0,1,0x5da40000,3,0=0x5db0b000,0,1,0x5db40000,1,0 29 | 0x5db0b000,0,1,0x5da40200,1,0=0x5db0b000,0,1,0x5db40000,1,0 30 | 0x5db0b000,2,0,0x5da40200,1,0=0x5db0b000,2,0,0x5db40000,3,0 31 | ; 32 | ;<_D2-End-(2) 33 | ; 34 | 0x5db0b800,0,0,0x5da40000,1,0=0x5db0b800,0,0,0x5db40000,1,0 35 | 0x5db0b800,0,0,0x5da40000,3,0=0x5db0b800,0,0,0x5db40000,1,0 36 | 0x5db0b800,2,1,0x5da40000,1,0=0x5db0b800,2,1,0x5db40000,3,0 37 | 0x5db0b800,2,1,0x5da40000,3,0=0x5db0b800,2,1,0x5db40000,3,0 38 | 0x5db0b800,0,0,0x5da40200,1,0=0x5db0b800,0,0,0x5db40000,1,0 39 | 0x5db0b800,2,1,0x5da40200,1,0=0x5db0b800,2,1,0x5db40000,3,0 -------------------------------------------------------------------------------- /Controller/INRULs/LightrailBasic/RUL0F_LightRail_Basic.rul: -------------------------------------------------------------------------------- 1 | #Transmogrify 2 | 1,0,2,0,2 3 | 3,0,0x08031500,0,0 4 | 5 | 1,0,0,0,2 6 | 3,0,0x08000500,0,0 7 | 8 | 1,00,00,01,03 9 | 3,0,0x08001A00,0,0 10 | 11 | 1,00,00,01,23 12 | 3,0,0x08001C00,0,0 13 | 14 | 1,00,00,11,22 15 | 3,0,0x08002200,0,0 16 | 17 | 1,00,01,62,03 18 | 3,0,0x08014E00,0,0 19 | 20 | 1,00,11,00,11 21 | 3,0,0x08018B00,0,0 22 | 23 | 1,00,11,00,13 24 | 3,0,0x08019500,0,0 25 | 26 | 1,00,21,22,02 27 | 3,0,0x08029700,0,0 28 | 29 | 1,00,21,13,02 30 | 3,0,0x0802F900,0,0 31 | 32 | 1,00,02,00,22 33 | 3,0,0x08031600,0,0 34 | 35 | 1,00,02,00,32 36 | 3,0,0x08031700,0,0 37 | 38 | 1,00,02,00,62 39 | 3,0,0x08031A00,0,0 40 | 41 | 1,00,02,00,72 42 | 3,0,0x08031B00,0,0 43 | 44 | 1,00,02,01,32 45 | 3,0,0x08032500,0,0 46 | 47 | 1,01,72,03,02 48 | 3,0,0x0812FF00,0,0 49 | 50 | 1,02,02,02,02 51 | 3,0,0x082E2D00,0,0 52 | 53 | 1,0,21,32,2 54 | 3,0,0x08aa6500,0,0 55 | 56 | 1,0,13,0,42 57 | 3,0,0x08019500,0,1 58 | 59 | 1,0,0,1,22 60 | 3,0,0x08002200,0,0 61 | 62 | 1,0,0,1,13 63 | 3,0,0x08002200,0,0 64 | 65 | 1,0,0,21,13 66 | 3,0,0x08002200,0,0 67 | 68 | 1,23,0,0,42 69 | 3,0,0x08002200,0,1 70 | 71 | 1,13,0,0,42 72 | 3,0,0x08002200,0,1 73 | 74 | 1,3,0,0,42 75 | 3,0,0x08002200,0,1 76 | 77 | 1,2,1,23,0 78 | 3,0,0x0802F900,3,1 79 | 80 | 1,23,0,0,21 81 | 3,0,0x08001A00,1,0 82 | 83 | 1,0,2,0,13 84 | 3,0,0x08031600,0,0 85 | 86 | 1,21,72,23,2 87 | 3,0,0x0812ff00,0,0 88 | 89 | 1,23,0,21,62 90 | 3,0,0x08014e00,1,0 91 | 92 | 1,0,42,0,42 93 | 3,0,0x08018b00,0,0 94 | 95 | 1,0,11,0,42 96 | 3,0,0x08018b00,0,0 97 | 98 | 1,2,21,23,0 99 | 3,0,0x08aa6500,3,1 100 | 101 | 1,0,72,0,42 102 | 3,0,0x08aa1400,0,0 103 | 104 | 1,0,72,0,11 105 | 3,0,0x08aa1400,0,0 106 | 107 | 1,0,2,3,2 108 | 3,0,0x08aa2000,0,0 109 | 110 | 1,0,2,1,32 111 | 2,7,1,32,0,2 112 | 3,0,0x08aa2000,2,1 113 | 3,7,0x08aa2000,0,1 114 | 115 | 1,00,00,00,01 116 | 3,0,0x08000200,0,0 117 | 118 | 1,0,21,3,13 119 | 3,0,0x08aa5000,0,0 120 | 121 | 1,0,21,3,22 122 | 3,0,0x08aa5000,0,0 123 | 124 | 1,0,21,62,23 125 | 3,0,0x08aa6300,0,0 -------------------------------------------------------------------------------- /Controller/INRULs/MonorailBasic/RUL15_Monorail_Basic.rul: -------------------------------------------------------------------------------- 1 | #Transmogrify 2 | 1,0,2,0,2 3 | 3,0,0x0d031500,0,0 4 | 5 | 1,0,0,0,2 6 | 3,0,0x0d000500,0,0 7 | 8 | 1,00,00,01,03 9 | 3,0,0x0d001A00,0,0 10 | 11 | 1,00,00,01,23 12 | 3,0,0x0d001C00,0,0 13 | 14 | 1,00,00,11,22 15 | 3,0,0x0d002200,0,0 16 | 17 | 1,00,01,62,03 18 | 3,0,0x0d014E00,0,0 19 | 20 | 1,00,11,00,11 21 | 3,0,0x0d018B00,0,0 22 | 23 | 1,00,11,00,13 24 | 3,0,0x0d019500,0,0 25 | 26 | 1,00,21,22,02 27 | 3,0,0x0d029700,0,0 28 | 29 | 1,00,21,13,02 30 | 3,0,0x0d02F900,0,0 31 | 32 | 1,00,02,00,22 33 | 3,0,0x0d031600,0,0 34 | 35 | 1,00,02,00,32 36 | 3,0,0x0d031700,0,0 37 | 38 | 1,00,02,00,62 39 | 3,0,0x0d031A00,0,0 40 | 41 | 1,00,02,00,72 42 | 3,0,0x0d031B00,0,0 43 | 44 | 1,00,02,01,32 45 | 3,0,0x0d032500,0,0 46 | 47 | 1,01,72,03,02 48 | 3,0,0x0d12FF00,0,0 49 | 50 | 1,02,02,02,02 51 | 3,0,0x0d2E2D00,0,0 52 | 53 | 1,0,21,32,2 54 | 3,0,0x0daa6500,0,0 55 | 56 | 1,0,13,0,42 57 | 3,0,0x0d019500,0,1 58 | 59 | 1,0,0,1,22 60 | 3,0,0x0d002200,0,0 61 | 62 | 1,0,0,1,13 63 | 3,0,0x0d002200,0,0 64 | 65 | 1,0,0,21,13 66 | 3,0,0x0d002200,0,0 67 | 68 | 1,23,0,0,42 69 | 3,0,0x0d002200,0,1 70 | 71 | 1,13,0,0,42 72 | 3,0,0x0d002200,0,1 73 | 74 | 1,3,0,0,42 75 | 3,0,0x0d002200,0,1 76 | 77 | 1,2,1,23,0 78 | 3,0,0x0d02F900,3,1 79 | 80 | 1,23,0,0,21 81 | 3,0,0x0d001A00,1,0 82 | 83 | 1,0,2,0,13 84 | 3,0,0x0d031600,0,0 85 | 86 | 1,21,72,23,2 87 | 3,0,0x0d12ff00,0,0 88 | 89 | 1,23,0,21,62 90 | 3,0,0x0d014e00,1,0 91 | 92 | 1,0,42,0,42 93 | 3,0,0x0d018b00,0,0 94 | 95 | 1,0,11,0,42 96 | 3,0,0x0d018b00,0,0 97 | 98 | 1,2,21,23,0 99 | 3,0,0x0daa6500,3,1 100 | 101 | 1,0,72,0,42 102 | 3,0,0x0daa1400,0,0 103 | 104 | 1,0,72,0,11 105 | 3,0,0x0daa1400,0,0 106 | 107 | 1,0,2,3,2 108 | 3,0,0x0daa2000,0,0 109 | 110 | 1,0,2,1,32 111 | 2,7,1,32,0,2 112 | 3,0,0x0daa2000,2,1 113 | 3,7,0x0daa2000,0,1 114 | 115 | 1,00,00,00,01 116 | 3,0,0x0d000200,0,0 117 | 118 | 1,0,21,3,13 119 | 3,0,0x0daa5000,0,0 120 | 121 | 1,0,21,3,22 122 | 3,0,0x0daa5000,0,0 123 | 124 | 1,0,21,62,23 125 | 3,0,0x0daa6300,0,0 126 | ;Added for Rail Onslopes (eggman121) 127 | 1,0,4,0,4 128 | 3,0,0x03031500,0,0 129 | 130 | 1,0,4,4,4 131 | 3,0,0x03031500,0,0 -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7h_Flex_Transition/Sec7h6_FlexHT_MRC_Adjacencies_Diag.txt: -------------------------------------------------------------------------------- 1 | ;-OxD-MRC-FLEX-HT 2 | ; 3 | ;L1 RHW2 Street 4 | ; 5 | ;0x5770a800,3,0,0x57007000,3,1=0x5770a800,3,0,0x57107000,3,1 6 | ;0x5770a800,1,1,0x57007000,1,0=0x5770a800,1,1,0x57107000,1,0 7 | ; 8 | ;L1 RHW2 Road 9 | ; 10 | ;0x5770a800,3,0,0x57007100,3,1=0x5770a800,3,0,0x57107100,3,1 11 | ;0x5770a800,1,1,0x57007100,1,0=0x5770a800,1,1,0x57107100,1,0 12 | ; 13 | ;L1 RHW2 OWR 14 | ; 15 | ;0x5770a800,3,0,0x57007200,3,1=0x5770a800,3,0,0x57107200,3,1 16 | ;0x5770a800,1,1,0x57007200,1,0=0x5770a800,1,1,0x57107200,1,0 17 | ; 18 | ;L1 RHW2 Avenue 19 | ; 20 | ;0x5770a800,3,0,0x57007309,3,1=0x5770a800,3,0,0x57107300,3,1 21 | ;0x5770a800,1,1,0x57007309,1,0=0x5770a800,1,1,0x57107300,1,0 22 | ; 23 | ;L1 RHW2 Rail 24 | ; 25 | ;0x5770a800,3,0,0x57007500,3,1=0x5770a800,3,0,0x57107500,3,1 26 | ;0x5770a800,1,1,0x57007500,1,0=0x5770a800,1,1,0x57107500,1,0 27 | ; 28 | ;MIS x Road 29 | ; 30 | ;L1 31 | ; 32 | ; 33 | ;L2 34 | ; 35 | ; 36 | ;L2 37 | ; 38 | ; 39 | ;L3 40 | ; 41 | ; 42 | ;MIS x OneWayRoad 43 | ; 44 | ;L1 45 | ; 46 | ; 47 | ;L2 48 | ; 49 | ; 50 | ;L2 51 | ; 52 | ; 53 | ;L3 54 | ; 55 | ; 56 | ;MIS x Avenue 57 | ; 58 | ;L1 59 | ; 60 | ; 61 | ;L2 62 | ; 63 | ; 64 | ;L2 65 | ; 66 | ; 67 | ;L3 68 | ; 69 | ; 70 | ;MIS x RealRailway 71 | ; 72 | ;L1 73 | ; 74 | ; 75 | ;L2 76 | ; 77 | ; 78 | ;L2 79 | ; 80 | ; 81 | ;L3 82 | ; 83 | ; 84 | ;MIS x RHW-2 85 | ; 86 | ;L1 87 | ; 88 | ; 89 | ;L2 90 | ; 91 | ; 92 | ;L2 93 | ; 94 | ; 95 | ;L3 96 | ; 97 | ; 98 | ;RHW_4S x Road 99 | ; 100 | ;L1 101 | ; 102 | ; 103 | ;L2 104 | ; 105 | ; 106 | ;L2 107 | ; 108 | ; 109 | ;L3 110 | ; 111 | ; 112 | ;RHW_4S x OneWayRoad 113 | ; 114 | ;L1 115 | ; 116 | ; 117 | ;L2 118 | ; 119 | ; 120 | ;L2 121 | ; 122 | ; 123 | ;L3 124 | ; 125 | ; 126 | ;RHW_4S x Avenue 127 | ; 128 | ;L1 129 | ; 130 | ; 131 | ;L2 132 | ; 133 | ; 134 | ;L2 135 | ; 136 | ; 137 | ;L3 138 | ; 139 | ; 140 | ;RHW_4S x RealRailway 141 | ; 142 | ;L1 143 | ; 144 | ; 145 | ;L2 146 | ; 147 | ; 148 | ;L2 149 | ; 150 | ; 151 | ;L3 152 | ; 153 | ; 154 | ;RHW_4S x RHW_4S 155 | ; 156 | ;L1 157 | ; 158 | ; 159 | ;L2 160 | ; 161 | ; 162 | ;L2 163 | ; 164 | ; 165 | ;L3 166 | ; 167 | ; -------------------------------------------------------------------------------- /Controller/RUL0/7000_Road_NWM/7C00_SingleTileRoundabouts.txt: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;Single Tile Roundabout Puzzle Pieces Button 3 | 4 | RotationRing = 7C00, 7C01, 7C02, 7C03 ;Single Tile Road/Street Roundabout 5 | AddTypes = 7C10, 7C11, 7C12, 7C13 ;Single Tile Road/Street Roundabout 6 | 7 | ;###separator### 8 | 9 | [HighwayIntersectionInfo_0x00007C00] 10 | ;Added by Durfsurn 24/06/2020 11 | ; Road x Street Single Tile Roundabout 12 | Piece = 0.0, 16.0, 0, 0, 0x5F07CF00 13 | PreviewEffect = preview_rd_x_st_single_tile_roundabout 14 | 15 | CellLayout=... 16 | CellLayout=.a< 17 | CellLayout=.b. 18 | CellLayout=.^. 19 | 20 | CheckType = a - road: 0x02000200 21 | ;###RHD###CheckType = b - road: 0x02000200 street: 0x00020102, 0xffffffff optional 22 | ;###LHD###CheckType = b - road: 0x02000200 street: 0x00020302, 0xffffffff optional 23 | 24 | ConsLayout=... 25 | ConsLayout=.+< 26 | ConsLayout=... 27 | ConsLayout=.^. 28 | 29 | AutoTileBase = 0x55387000 30 | ReplacementIntersection = 0, 0 31 | PlaceQueryID = 0x5F07CF00 32 | Costs = 20 33 | 34 | [HighwayIntersectionInfo_0x00007C01] 35 | CopyFrom = 0x7C00 36 | Rotate = 1 37 | [HighwayIntersectionInfo_0x00007C02] 38 | CopyFrom = 0x7C00 39 | Rotate = 2 40 | [HighwayIntersectionInfo_0x00007C03] 41 | CopyFrom = 0x7C00 42 | Rotate = 3 43 | 44 | [HighwayIntersectionInfo_0x00007C10] 45 | ;Added by Durfsurn 24/06/2020 46 | ; Road x Road Single Tile Roundabout 47 | Piece = 0.0, 16.0, 0, 0, 0x5F07CC00 48 | PreviewEffect = preview_rd_x_rd_single_tile_roundabout 49 | 50 | CellLayout=... 51 | CellLayout=.a< 52 | CellLayout=.b. 53 | CellLayout=.^. 54 | 55 | CheckType = a - road: 0x02000200 56 | ;###RHD###CheckType = b - road: 0x02000202 street: 0x01020000, 0xffffffff optional 57 | ;###LHD###CheckType = b - road: 0x02000202 street: 0x03020000, 0xffffffff optional 58 | 59 | ConsLayout=... 60 | ConsLayout=.+< 61 | ConsLayout=... 62 | ConsLayout=.^. 63 | 64 | AutoTileBase = 0x55387000 65 | ReplacementIntersection = 0, 0 66 | PlaceQueryID = 0x5F07CC00 67 | Costs = 20 68 | 69 | [HighwayIntersectionInfo_0x00007C11] 70 | CopyFrom = 0x7C10 71 | Rotate = 1 72 | [HighwayIntersectionInfo_0x00007C12] 73 | CopyFrom = 0x7C10 74 | Rotate = 2 75 | [HighwayIntersectionInfo_0x00007C13] 76 | CopyFrom = 0x7C10 77 | Rotate = 3 -------------------------------------------------------------------------------- /src/scripts/compile-release-inruls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script compiles all INRUL files for inclusion in the installer. 4 | # 5 | # ./src/scripts/compile-release-inruls.sh 6 | # 7 | # The compiled INRUL files are located at `./target/controllers/`. 8 | 9 | set -e 10 | 11 | if [ ! -e "Controller" ] 12 | then 13 | echo "Call this script from the root directory of the Network-Addon-Mod repository." 14 | exit 1 15 | fi 16 | 17 | PROJECT_ROOT="$(pwd)" 18 | TEMP="target/controllers/temp" 19 | mkdir -p "$TEMP" 20 | 21 | BUILDRULS_ARCHIVE="target/BuildRULs_01.zip" 22 | BUILDRULS_URL="https://www.dropbox.com/s/ckwhy11xxaz3z1q/BuildRULs_01.zip?dl=1" 23 | 24 | if [ ! -e "$BUILDRULS_ARCHIVE" ] 25 | then 26 | # download compiler if it does not yet exist 27 | curl -L "$BUILDRULS_URL" > "$BUILDRULS_ARCHIVE" 28 | fi 29 | echo "08816a61cb64c80392328f874c3b5bc031580514c156839af9a8359784a72071 $BUILDRULS_ARCHIVE" | sha256sum --check 30 | unzip -d "$TEMP" "$BUILDRULS_ARCHIVE" 31 | 32 | # build all INRULs 33 | (cd "$TEMP/BuildRULs_01" && java -jar BuildRULs.jar -f "$PROJECT_ROOT/Controller/INRULs/" "$PROJECT_ROOT/Controller/INRULs/") 34 | 35 | # RHD 4GB Full 36 | DESTDIR="target/controllers/@0=0 NAM Controller_RHD_4GB_Full/" 37 | mkdir -p "$DESTDIR" 38 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_RHD.dat" "$DESTDIR" 39 | 40 | # LHD 4GB Full 41 | DESTDIR="target/controllers/@1-0 NAM Controller_LHD_4GB_Full/" 42 | mkdir -p "$DESTDIR" 43 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_LHD.dat" "$DESTDIR" 44 | 45 | # RHD no-RHW 46 | DESTDIR="target/controllers/@2-0 NAM Controller_RHD_LowRAM_NoRHW/" 47 | mkdir -p "$DESTDIR" 48 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_RHD.dat" "$DESTDIR" 49 | 50 | # LHD no-RHW 51 | DESTDIR="target/controllers/@3-0 NAM Controller_LHD_LowRAM_NoRHW/" 52 | mkdir -p "$DESTDIR" 53 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_LHD.dat" "$DESTDIR" 54 | 55 | # Avenue turning lanes 56 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_TurningLanes_Avenues_Plugin_INRULs.dat" "target/controllers/" 57 | 58 | # advisor messages 59 | cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_Advice.dat" "target/controllers/" 60 | 61 | rm -rf "$TEMP" 62 | -------------------------------------------------------------------------------- /src/scripts/remove-nwm-adjacencies.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # A one-time script for removing manually written adjacency code for NWM which becomes redundant with the DLL. 4 | 5 | import os 6 | from enum import Enum 7 | 8 | class State(Enum): 9 | INIT = 0 10 | # BASEOVERRIDE = 1 11 | ADJACENCY = 2 12 | SECTIONENDED = 3 13 | SECTIONENDEDSKIP = 4 14 | 15 | for parent, dirs, files in os.walk("Controller/RUL2/08_NWM"): 16 | for fname in files: 17 | if fname in ["00_Orthogonal_NWM.txt", "02_Diagonal_NWM.txt"]: 18 | continue # base orthogonals and diagonals must be kept 19 | 20 | p = os.path.join(parent, fname) 21 | p_tmp = os.path.join(parent, f"{fname}.tmp") 22 | state = State.INIT 23 | 24 | with open(p, encoding='utf-8') as file: 25 | with open (p_tmp, 'w', encoding='utf-8') as file_tmp: 26 | 27 | for line in file: 28 | if any(heading in line for heading in ["---OxO", "---OxD", "---DxO", "---DxD"]): 29 | state = State.ADJACENCY 30 | elif any(heading in line for heading in ["---END OxO", "---END OxD", "---END DxO", "---END DxD"]): 31 | state = State.SECTIONENDEDSKIP 32 | elif "---END L" in line: 33 | state = State.SECTIONENDED 34 | elif any(heading in line for heading in [ 35 | "---Other Base Crossings---", 36 | "---Other Network Transitions---", 37 | " Transition Hooks---", 38 | ]): 39 | state = State.SECTIONENDED 40 | else: 41 | pass 42 | 43 | if state == State.ADJACENCY: 44 | pass 45 | elif state == State.SECTIONENDEDSKIP: 46 | state = State.SECTIONENDED # and skip writing 47 | else: 48 | file_tmp.write(line) 49 | 50 | if state == State.INIT: 51 | os.remove(p_tmp) 52 | else: 53 | os.replace(p_tmp, p) 54 | if state != State.SECTIONENDED: 55 | print(f"Terminated with unexpected state in file {fname}") 56 | -------------------------------------------------------------------------------- /Controller/RUL2/03_Turn_Lanes/Sec3g_Rural FTL.txt: -------------------------------------------------------------------------------- 1 | ;----(Rural_Flex Turn Lanes)--------; 2 | ; 3 | ;Overrides the Flex Piece for the Rural counterpart of the FTL system. 4 | ; 5 | ;Base (T Intersection) Road 6 | ; 7 | 0x00aa0100,3,0,0x00aa0800,1,0=0x00004b00,1,0,0x5B206100,1,0 8 | 0x00004b00,1,0,0x00aa0800,1,0=0x00004b00,1,0,0x5B206100,1,0 9 | 0x00004b00,3,0,0x00aa0800,1,0=0x00004b00,3,0,0x5B206100,1,0 10 | 0x00aa0100,3,0,0x5B206100,1,0=0x00004b00,1,0,0x5B206100,1,0 11 | ; 12 | ;Base (Cross Intersection) Road 13 | ; 14 | 0x00aa0100,3,0,0x00aa0a00,1,0=0x00004b00,1,0,0x5B206000,1,0 15 | 0x00004b00,1,0,0x00aa0a00,1,0=0x00004b00,1,0,0x5B206000,1,0 16 | 0x00004b00,3,0,0x00aa0a00,1,0=0x00004b00,3,0,0x5B206000,1,0 17 | 0x00aa0100,3,0,0x00aa0a00,3,0=0x00004b00,1,0,0x5B206000,3,0 18 | 0x00004b00,1,0,0x00aa0a00,3,0=0x00004b00,1,0,0x5B206000,3,0 19 | 0x00004b00,3,0,0x00aa0a00,3,0=0x00004b00,3,0,0x5B206000,3,0 20 | 0x5B206000,1,0,0x00aa0100,1,0=0x5B206000,1,0,0x00004b00,1,0 21 | 0x5B206000,3,0,0x00aa0100,1,0=0x5B206000,3,0,0x00004b00,1,0 22 | 0x00aa0100,3,0,0x5B206000,1,0=0x00004b00,1,0,0x5B206000,1,0; conflicting-override 23 | 0x00aa0100,3,0,0x5B206000,3,0=0x00004b00,1,0,0x5B206000,3,0; conflicting-override 24 | 25 | ; 26 | ;Base (Cross and T Intersection) Avenue 27 | ; 28 | 0x00aa0100,3,0,0x04008300,2,0=0x00004b00,1,0,0x5B206200,2,0 29 | 0x00004b00,1,0,0x04008300,2,0=0x00004b00,1,0,0x5B206200,2,0 30 | 0x00004b00,3,0,0x04008300,2,0=0x00004b00,3,0,0x5B206200,2,0 31 | 0x00aa0100,3,0,0x5B206200,2,0=0x00004b00,1,0,0x5B206200,2,0 32 | 0x5B206200,2,0,0x04008600,0,0=0x5B206200,2,0,0x5B206300,0,0 33 | ; 34 | ;FTL Type 110 x Road 35 | ;+ 36 | 0x5B200000,1,0,0x5B206000,0,0=0x5B200000,1,0,0x5B207380,1,0 37 | 0x5B200000,1,0,0x5B206000,2,0=0x5B200000,1,0,0x5B207380,3,0 38 | ; 39 | 0x5B200000,3,1,0x5B206000,0,0=0x5B200000,3,1,0x5B207380,3,1 40 | 0x5B200000,3,1,0x5B206000,2,0=0x5B200000,3,1,0x5B207380,1,1 41 | ;Stability 42 | 0x00aa0100,3,0,0x5B207380,0,0=0x00004b00,1,0,0x5B207380,0,0 43 | 0x00aa0100,3,0,0x5B207380,2,0=0x00004b00,1,0,0x5B207380,2,0 44 | 0x00aa0100,3,0,0x5B207380,0,1=0x00004b00,1,0,0x5B207380,0,1 45 | 0x00aa0100,3,0,0x5B207380,2,1=0x00004b00,1,0,0x5B207380,2,1 46 | ;T 47 | 0x5B200000,1,0,0x5B206100,2,0=0x5B200000,1,0,0x5B207480,3,0 48 | ; 49 | 0x5B200000,3,1,0x5B206100,0,0=0x5B200000,3,1,0x5B207480,1,1 50 | ;Stability 51 | 0x00aa0100,3,0,0x5B207480,2,0=0x00004b00,1,0,0x5B207480,2,0 52 | 0x00aa0100,3,0,0x5B207480,0,1=0x00004b00,1,0,0x5B207480,0,1 53 | -------------------------------------------------------------------------------- /src/test/scala/module/RhwResolverSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | import io.github.memo33.metarules.meta._ 6 | import syntax._, Implicits._, RotFlip._, Network._, Flags._, NetworkProperties._ 7 | 8 | class RhwResolverSpec extends AnyWordSpec with Matchers { 9 | 10 | "RhwResolver" should { 11 | val resolve = new RhwResolver 12 | "have correctly initialized IIDs" in { 13 | assert { 14 | Network.values.forall { n => 15 | (RhwResolver.rhwPieceId.contains(n) || !RhwResolver.rhwRangeId.contains(n)) && 16 | (RhwResolver.rhwPieceId.get(n) forall { id => id / 0x10 % 0x10 == n.height }) && 17 | (RhwResolver.rhwRangeId.get(n) forall { id => id / 0x100000 % 0x10 == n.height && id / 0x10000000 == 5 }) 18 | } 19 | } 20 | } 21 | "be a 1-to-1 correspondence (bijective)" in { 22 | val reverseTileMap = resolve.tileMap.map { case (a, b) => (b, a) } 23 | for ((tile, idTile) <- resolve.tileMap) { 24 | val tile2 = reverseTileMap(idTile) 25 | if (!tile.segs.exists(_.network.isTla)) { 26 | tile2.shouldBe(tile) 27 | } else { 28 | unprojectTla(tile2).shouldBe(unprojectTla(tile)) 29 | } 30 | } 31 | } 32 | "use only expected 8th digits" in { 33 | val expected8thDigits = Set(0x0, 0x5, 0x9, 0xa) 34 | for ((tile, idTile) <- resolve.tileMap) { 35 | withClue((tile, idTile)) { 36 | expected8thDigits should contain (idTile.id % 0x10) 37 | } 38 | } 39 | } 40 | "handle OWR-4 shared-tile diagonals correctly" in { 41 | val crossingDirs = Seq(0x3000 -> Seq(EW, WE, NS, SN), 0x9000 -> Seq(NE, EN, SW, WS)) 42 | for ((offset, dirs) <- crossingDirs; dir <- dirs) { 43 | (resolve(Owr4~SE & Owr4m~NW & L1Rhw4~dir).id & 0xffffff00).shouldBe(RhwResolver.rhwRangeId(L1Rhw4) + RhwResolver.rhwPieceId(Owr4) + offset) 44 | (resolve(Owr4~ES & L1Rhw4~dir).id & 0xffffff00).shouldBe(RhwResolver.rhwRangeId(L1Rhw4) + RhwResolver.rhwPieceId(Owr4) + offset) 45 | (resolve(Owr4m~WN & L1Rhw4~dir).id & 0xffffff00).shouldBe(RhwResolver.rhwRangeId(L1Rhw4) + RhwResolver.rhwPieceId(Owr4m) + offset) 46 | intercept[Exception](resolve(Owr4~SE & L1Rhw4~dir)) // not defined 47 | intercept[Exception](resolve(Owr4m~NW & L1Rhw4~dir)) // not defined 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lua/adv_nam_dll.lua: -------------------------------------------------------------------------------- 1 | --#-package:2A504B00# -- package signature 2 | ---------------------------------------------------------------------- 3 | -- This file defines advisor messages related to the NAM DLL. 4 | 5 | -- Note that this Lua file is not intended for distribution with the DLL itself, but for distribution with the NAM DBPF files to ensure compatibility between NAM and DLL. 6 | nam_dll_version_expected = "1.2.0" -- needs to be updated whenever a new DLL version is released 7 | 8 | -- (When this script is first executed, the `nam_dll_version` is still `nil`, but it gets defined before the trigger conditions are evaluated.) 9 | function is_nam_dll_correct() 10 | local version = rawget(globals(), "nam_dll_version") 11 | return version ~= nil and version == nam_dll_version_expected 12 | end 13 | 14 | ------------ Advice record ---- 15 | a = create_advice_transportation('2a504ba0') 16 | a.trigger = "not is_nam_dll_correct()" 17 | a.title = [[text@2a504ba0 Traffic Planners Have Lost The Plot]] 18 | a.message = [[text@2a504ba1 They could not find the correct NAM DLL file in your Plugins. Required NAM DLL version: #nam_dll_version_expected#, Installed NAM DLL version: #nam_dll_version or 'not installed'#]] 19 | a.once = 0 -- must be 0, since 1 means once per city (saving after closing the message would prevent message from ever appearing again, even after restarting the game or upgrading to a newer DLL version – unless the GUID is changed for every new DLL version) 20 | a.persist = 1 -- irrelevant as trigger is not random (after game is restarted with correct DLL, the trigger seems to be evaluated anyway, so message disappears) 21 | a.frequency = 90 -- days 22 | a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT 23 | a.no_timeout = 1 -- message stays active in background after closing popup, so the popup doesn't reappear every few months 24 | a.priority = tuning_constants.ADVICE_PRIORITY_URGENT 25 | a.mood = advice_moods.BAD_JOB 26 | 27 | ------------ Advice record ---- 28 | -- for debugging only 29 | -- a = create_advice_transportation('2a504b90') 30 | -- a.trigger = "is_nam_dll_correct()" 31 | -- a.title = [[Debug: Traffic Planners On The Right Track]] 32 | -- a.message = [[The correct version of the NAM DLL is installed: #nam_dll_version or 'not installed'#]] 33 | -- a.once = 0 34 | -- a.persist = 1 35 | -- a.frequency = 90 36 | -- a.timeout = tuning_constants.ADVICE_TIMEOUT_SHORT 37 | -- a.no_timeout = 1 38 | -- a.priority = tuning_constants.ADVICE_PRIORITY_URGENT 39 | -- a.mood = advice_moods.GREAT_JOB 40 | -------------------------------------------------------------------------------- /src/test/scala/scripts/RedundantAdjacenciesCheckerSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.scripts 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | import io.github.memo33.metarules.meta._ 6 | import com.sc4nam.module._ 7 | import syntax._, Implicits._, RotFlip._, Network._, Flags._, NetworkProperties._ 8 | import RedundantAdjacenciesChecker.isRedundantAdjacency 9 | 10 | class RedundantAdjacenciesCheckerSpec extends AnyWordSpec with Matchers { 11 | 12 | "redundant adjacencies" should { 13 | "be compatible for equivalent rules" in { 14 | val rul2 = Seq( 15 | Rule(0x57227C10,2,0,0x57000000,1,0,0x57227C10,2,0,0x57120000,3,0), 16 | Rule(0x57227C10,2,0,0x57000000,3,0,0x57227C10,2,0,0x57120000,3,0), 17 | Rule(0x57227C10,2,0,0x57000000,1,1,0x57227C10,2,0,0x57120000,3,1), 18 | Rule(0x57227C10,2,0,0x57000000,3,1,0x57227C10,2,0,0x57120000,3,1), 19 | Rule(0x57120000,3,0,0x57031A00,0,0,0x57120000,3,0,0x57121D00,3,0), 20 | Rule(0x57120000,1,0,0x57031A00,0,0,0x57120000,1,0,0x57121D00,1,1), 21 | Rule(0x57120000,3,0,0x57031A00,2,0,0x57120000,3,0,0x57121D00,3,1), 22 | Rule(0x57120000,1,0,0x57031A00,2,0,0x57120000,1,0,0x57121D00,1,0), 23 | // 24 | Rule(0x5C020A00,0,1,0x04006100,1,0,0x5C020A00,0,1,0x5C020000,1,0), 25 | Rule(0x5C020A00,2,0,0x04006100,3,0,0x5C020A00,2,0,0x5C020000,3,0), 26 | Rule(0x5C020000,1,0,0x04006300,0,0,0x5C020000,1,0,0x5C020A00,0,0), 27 | Rule(0x5C020000,3,0,0x04006300,2,1,0x5C020000,3,0,0x5C020A00,2,1), 28 | ) 29 | val lookupRule = rul2.map(r => (new EquivRule(r), r)).toMap 30 | val adjacencies = Seq( 31 | Rule(0x57227c10,0,1,0x57031a00,0,0,0x57227c10,0,1,0x57121d00,1,1), 32 | Rule(0x57227c10,2,0,0x57031a00,2,1,0x57227c10,2,0,0x57121d00,3,0), 33 | Rule(0x57031a00,2,0,0x57227c10,2,1,0x57121d00,3,1,0x57227c10,2,1), 34 | Rule(0x57031a00,0,1,0x57227c10,0,0,0x57121d00,1,0,0x57227c10,0,0), 35 | // 36 | Rule(0x5C020A00,2,0,0x04006300,2,1,0x5C020A00,2,0,0x5C020A00,2,1), 37 | Rule(0x5C020A00,0,1,0x04006300,0,0,0x5C020A00,0,1,0x5C020A00,0,0), 38 | Rule(0x04006300,0,1,0x5C020A00,0,0,0x5C020A00,0,1,0x5C020A00,0,0), 39 | Rule(0x04006300,2,0,0x5C020A00,2,1,0x5C020A00,2,0,0x5C020A00,2,1), 40 | ) 41 | for (rule <- adjacencies) { 42 | withClue(rule) { 43 | isRedundantAdjacency(rule, lookupRule).shouldBe(true) 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/scala/module/CompileAllMetarules.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import java.io.File 4 | import io.github.memo33.metarules.meta.RotFlip 5 | import syntax.{RuleGenerator, IdResolver, RuleTransducer} 6 | 7 | /** This is the main class that invokes the compilation of all metarules. New 8 | * metarule code generators need to be added to the list of invocations in this 9 | * file. Make sure the generated files end in "_MANAGED" to keep them from 10 | * getting tracked. 11 | */ 12 | object CompileAllMetarules { 13 | 14 | def main(args: Array[String]): Unit = { 15 | LOGGER.info("compiling FlexFly RUL0 and RUL1") 16 | flexfly.CompileFlexFlyRul0And1.main(Array.empty) 17 | // Generate FlexFly models and paths (requires some .dat files, see comment in that file). 18 | flexfly.CompileFlexFlyResources.main(Array.empty) 19 | 20 | // Compilation of metarule code. 21 | RegenerateTileOrientationCache.withCache(compileMetarulesOnce) 22 | 23 | // For the time being, INRUL compilation is disabled as the INRULs have been 24 | // merged into single files again. 25 | // CompileInruls.main(Array.empty) 26 | 27 | // Compile paths for diagonal NWM crossings 28 | LOGGER.info("compiling diagonal NWM paths") 29 | com.sc4nam.pathing.nwmpaths.Main.main(Array.empty) 30 | } 31 | 32 | /** Add additional rule generators here. 33 | */ 34 | def compileMetarulesOnce(tileOrientationCache: RuleTransducer.TileOrientationCache): Unit = { 35 | LOGGER.info("compiling FlexFly metarule code") 36 | flexfly.CompileFlexFlyCode.start(tileOrientationCache = tileOrientationCache) 37 | LOGGER.info("compiling RRW metarule code") 38 | CompileRealRailwayCode.start(tileOrientationCache = tileOrientationCache) 39 | LOGGER.info("compiling RHW metarule code") 40 | CompileRhwCode.start(tileOrientationCache = tileOrientationCache) 41 | LOGGER.info("compiling NWM metarule code") 42 | CompileNwmCode.start(tileOrientationCache = tileOrientationCache) 43 | LOGGER.info("compiling GLR metarule code") 44 | CompileGlrCode.start(tileOrientationCache = tileOrientationCache) 45 | LOGGER.info("compiling SAM metarule code") 46 | CompileSamCode.start(tileOrientationCache = tileOrientationCache) 47 | LOGGER.info("compiling Onslope metarule code") 48 | CompileOnslopeCode.start(tileOrientationCache = tileOrientationCache) 49 | LOGGER.info("compiling Roundabout metarule code") 50 | CompileRoundaboutCode.start(tileOrientationCache = tileOrientationCache) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ltext/puzzlepieces-avenue.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "PO-Revision-Date: \n" 5 | "Last-Translator: \n" 6 | "Language-Team: \n" 7 | "Language: en\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | 12 | msgctxt "2026960B-2A592FD1-5413B700" 13 | msgid "AvenuexGround Light Rail Puzzle Piece" 14 | msgstr "" 15 | 16 | msgctxt "2026960B-2A592FD1-5413C700" 17 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 18 | msgstr "" 19 | 20 | msgctxt "2026960B-2A592FD1-54192700" 21 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 22 | msgstr "" 23 | 24 | msgctxt "2026960B-2A592FD1-54193700" 25 | msgid "Straight Avenue OnSlope Puzzle Piece" 26 | msgstr "" 27 | 28 | msgctxt "2026960B-2A592FD1-54260130" 29 | msgid "Avenue Blank Terrain (no pylon)" 30 | msgstr "" 31 | 32 | msgctxt "2026960B-2A592FD1-54260800" 33 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 34 | msgstr "" 35 | 36 | msgctxt "2026960B-2A592FD1-5426E000" 37 | msgid "" 38 | "Roundabout Avenue 4x4\n" 39 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 40 | msgstr "" 41 | 42 | msgctxt "2026960B-2A592FD1-542B9540" 43 | msgid "Avenue 45-Curve" 44 | msgstr "" 45 | 46 | msgctxt "2026960B-2A592FD1-542B9550" 47 | msgid "Avenue 45-Curve (FLEX)" 48 | msgstr "" 49 | 50 | msgctxt "2026960B-2A592FD1-542BE000" 51 | msgid "Avenue 90-Curve" 52 | msgstr "" 53 | 54 | msgctxt "2026960B-2A592FD1-54300000" 55 | msgid "Avenue to Elevated Avenue - Long Transition" 56 | msgstr "" 57 | 58 | msgctxt "2026960B-2A592FD1-54300E00" 59 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 60 | msgstr "" 61 | 62 | msgctxt "2026960B-2A592FD1-54500000" 63 | msgid "Freeway Exit - Straight" 64 | msgstr "" 65 | 66 | msgctxt "2026960B-2A592FD1-54589520" 67 | msgid "Avenue x Street crossing with median" 68 | msgstr "" 69 | 70 | msgctxt "2026960B-2A592FD1-54600000" 71 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 72 | msgstr "" 73 | 74 | msgctxt "2026960B-2A592FD1-54600500" 75 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 76 | msgstr "" 77 | 78 | msgctxt "2026960B-2A592FD1-54600800" 79 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 80 | msgstr "" 81 | 82 | msgctxt "2026960B-2A592FD1-5f491505" 83 | msgid "Avenue 5x5 90 Degree Curve" 84 | msgstr "" 85 | -------------------------------------------------------------------------------- /Controller/RUL2/03_Turn_Lanes/Sec3h_CFI.txt: -------------------------------------------------------------------------------- 1 | ;Type 220 Continuous Flow Intersection (CFI) 2 | ;Started by Tarkus 26Aug2018 3 | ;0x5B221000,1,0,0x5F473200,0,0=0x5B221000,1,0,0x5B248300,1,0 4 | ;0x5B248300,1,0,0x04006100,1,0=0x5B248300,1,0,0x5B248100,1,0 5 | ;0x00000C00,2,1,0x5B248300,0,0=0x5B248200,0,0,0x5B248300,0,0 6 | ;0x5B248300,0,0,0x5B221080,0,0=0x5B248300,0,0,0x5B248400,0,0 7 | ;0x5B248200,1,0,0x00004D00,1,0=0x5B248200,1,0,0x5B248000,1,0 8 | ; 9 | ;0x5B248000,1,0,0x00004b00,1,0=0x5B248000,1,0,0x5B200400,1,0 10 | ;0x5B248000,1,0,0x00004b00,3,0=0x5B248000,1,0,0x5B200400,1,0 11 | ;replace 04006100 with new turn restriction IID when ready 12 | ;0x5B248400,1,0,0x5B221080,1,0=0x5B248400,1,0,0x5F441000,1,0 13 | ;0x5B248400,1,0,0x04006100,3,0=0x5B248400,1,0,0x5F441000,1,0 14 | 15 | ;0x5F441000,1,0,0x04006100,3,0=0x5F441000,1,0,0x5F441000,1,0 16 | ;0x5F441000,1,0,0x5B221080,1,0=0x5F441000,1,0,0x5F441000,1,0 17 | 18 | ;side intersection 19 | ;FTL 110 conversion 20 | ;IID is temporary 21 | ;0x5B200400,1,0,0x5B227300,0,0=0x5B200400,1,0,0x5B247000,0,0 22 | ;0x5B200400,1,0,0x5B227380,0,0=0x5B200400,1,0,0x5B247000,0,0 23 | ;0x5B200000,1,0,0x5B227380,0,0=0x5B200400,1,0,0x5B247000,0,0 24 | ;0x5B200400,1,0,0x5B228000,0,0=0x5B200400,1,0,0x5B247000,0,0 25 | ;0x5B200000,1,0,0x5B228080,0,0=0x5B200400,1,0,0x5B247000,0,0 26 | ;0x5B200000,1,0,0x5B247000,0,0=0x5B200400,1,0,0x5B247000,0,0 27 | ;0x5B200100,1,0,0x5B247000,0,0=0x5B200400,1,0,0x5B247000,0,0 28 | ; 29 | ;0x5B247000,0,0,0x04008800,0,0=0x5B247000,0,0,0x5B247100,0,0 30 | ;0x5B247000,0,0,0x5B227400,0,0=0x5B247000,0,0,0x5B247100,0,0 31 | ;0x5B247000,0,0,0x5B227400,0,0=0x5B247000,0,0,0x5B247100,0,0 32 | ;0x5B247000,0,0,0x5B228100,0,0=0x5B247000,0,0,0x5B247100,0,0 33 | ;Type 120 conversion 34 | ;0x5B220000,1,0,0x5B247100,3,0=0x5B220000,1,0,0x5B247300,3,0 35 | ;0x5B220080,1,0,0x5B247000,3,0=0x5B220080,1,0,0x5B247200,3,0 36 | 37 | ;0x5B247200,0,0,0x04008800,0,0=0x5B247200,0,0,0x5B247300,0,0 38 | 39 | ;0x5B200000,1,0,0x5B247200,0,0=0x5B200400,1,0,0x5B247200,0,0 40 | ;0x5B200100,1,0,0x5B247200,0,0=0x5B200400,1,0,0x5B247200,0,0 41 | 42 | ;future continuation onto Ave x Ave intersection and the like 43 | ;0x5F441000,1,0,0x5B229000,3,0=0x5F441100,1,0,0x5B229300,3,0 44 | ;0x5B229000,3,0,0x5B229300,2,0=0x5B229400,0,0,0x5B229300,2,0 45 | 46 | ;CFI conversion 47 | ;0x5B247300,3,0,0x5B229300,0,0=0x5B247300,3,0,0x5B247400,0,0 48 | ;0x5B247200,3,0,0x5B229400,0,0=0x5B247200,3,0,0x5B247500,0,0 49 | ;stability 50 | ;0x5B247400,0,0,0x5B229400,2,0=0x5B247400,0,0,0x5B247500,2,0 51 | ;0x5B247500,0,0,0x5B229300,2,0=0x5B247500,0,0,0x5B247400,2,0 52 | -------------------------------------------------------------------------------- /src/main/scala/scripts/MissingInstanceChecker.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.scripts 2 | 3 | import io.github.memo33.scdbpf, scdbpf.strategy.throwExceptions 4 | import io.github.memo33.metarules.meta.{RotFlip, EquivRule, Rule, IdTile} 5 | import com.sc4nam.module._ 6 | import Rul2Model.{Driveside, Rhd, Lhd, RhdAndLhd} 7 | 8 | object MissingInstanceChecker extends Rul2Checker { 9 | 10 | type Failure = Unit 11 | 12 | val allTags = Seq("missing_paths") 13 | 14 | val tagOf: Driveside => String = _ => allTags.head 15 | 16 | def failureToString(rule: Rule[IdTile], line: String, failure: Failure): String = s"missing paths: $line" 17 | 18 | val pathIds = collection.mutable.Set.empty[Int] 19 | 20 | /** Scans the RUL2 Controller files for IIDs that lack corresponding SC4PATHS 21 | * files. 22 | * 23 | * The SimCity_1.dat file and the folder containing all NAM dat files are 24 | * needed as input in order to check existence of SC4PATHS files. 25 | * 26 | * The identified rules are tagged in place as "missing_paths" as inline comment. 27 | * 28 | * Run with 29 | * {{{ 30 | * sbt 'runMain com.sc4nam.scripts.MissingInstanceChecker "" "' 31 | * }}} 32 | */ 33 | def main(args: Array[String]): Unit = { 34 | if (args.length-1 != 2) { 35 | System.err.println(s"Usage: Pass two arguments (instead of ${args.length-1}):") 36 | System.err.println(" 1. path to SimCity_1.dat") 37 | System.err.println(" 2. path to folder containing all NAM dat files") 38 | } else { 39 | val sc1datFile = new java.io.File(args(1)) 40 | val namInstallationDir = new java.io.File(args(2)) 41 | 42 | LOGGER.info(s"Scanning for IIDs of all SC4Path files in $namInstallationDir") 43 | pathIds ++= 44 | (scdbpf.Experimental.dbpfFileTreeIterator(namInstallationDir) ++ Iterator(sc1datFile)) 45 | .flatMap(scdbpf.DbpfFile.read(_).entries) 46 | .filter(_.tgi.matches(scdbpf.Tgi.Sc4Path)) 47 | .map(_.tgi.iid) 48 | LOGGER.info(s"Found ${pathIds.size} SC4Path files") 49 | 50 | LOGGER.info("Searching for rules with missing SC4Path IIDs in RUL2 code") 51 | runChecks(updateMode = true) 52 | } 53 | } 54 | 55 | def processRule(rule: Rule[IdTile], driveside: Driveside, line: String): Option[(Failure, Driveside)] = { 56 | if (rule.forall(tile => tile.id == 0 || pathIds.contains(tile.id))) { 57 | None // success 58 | } else { 59 | Some(((), driveside)) // failure 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7h_Flex_Transition/Sec7h3_FlexHT-DOST-Cross.txt: -------------------------------------------------------------------------------- 1 | ;-------------------------------------------- 2 | ;-----------------FLEX-DOST------------------ 3 | ;-------------------Cross-------------------- 4 | ;Stability using the cross intersection 57602400 5 | ; 6 | ;Disregard if other means are found to prevent issues with the section! 7 | ; 8 | ;-----------; 9 | ;L1 Section-; 10 | ;-----------; 11 | ; 12 | 0x57000000,1,0,0x57100200,0,0=0x57000000,1,0,0x57107a00,0,0 13 | 0x57000000,1,0,0x57100200,3,0=0x57000000,1,0,0x57107a00,2,1 14 | 0x57000000,3,0,0x57100200,0,0=0x57000000,3,0,0x57107a00,0,0 15 | 0x57000000,3,0,0x57100200,3,0=0x57000000,3,0,0x57107a00,2,1 16 | 0x57107a00,0,0,0x57000000,1,0=0x57107a00,0,0,0x57107a00,2,0 17 | 0x57107a00,2,1,0x57000000,1,0=0x57107a00,2,1,0x57107a00,0,1 18 | 0x57107a00,0,0,0x57000000,3,0=0x57107a00,0,0,0x57107a00,2,0 19 | 0x57107a00,2,1,0x57000000,3,0=0x57107a00,2,1,0x57107a00,0,1 20 | ; 21 | 0x57107a00,0,0,0x57600400,3,0=0x57107a00,0,0,0x57107a00,2,0 22 | 0x57107a00,2,1,0x57600400,1,0=0x57107a00,2,1,0x57107a00,0,1 23 | 0x57107a00,0,0,0x57602400,3,1=0x57107a00,0,0,0x57107a00,2,0 24 | 0x57107a00,2,1,0x57602400,1,0=0x57107a00,2,1,0x57107a00,0,1 25 | 0x57107a00,1,1,0x57000500,3,1=0x57107a00,1,1,0x57100200,2,0 26 | 0x57107a00,3,0,0x57000500,1,0=0x57107a00,3,0,0x57100200,1,0; conflicting-override 27 | 0x57107a00,1,1,0x57602400,2,0=0x57107a00,1,1,0x57107a00,3,1 28 | 0x57107a00,3,0,0x57602400,0,1=0x57107a00,3,0,0x57107a00,1,0 29 | ; 30 | ;-----------; 31 | ;L2 Section-; 32 | ;-----------; 33 | ; 34 | 0x57000000,1,0,0x57200200,0,0=0x57000000,1,0,0x57207a00,0,0 35 | 0x57000000,1,0,0x57200200,3,0=0x57000000,1,0,0x57207a00,2,1 36 | 0x57000000,3,0,0x57200200,0,0=0x57000000,3,0,0x57207a00,0,0 37 | 0x57000000,3,0,0x57200200,3,0=0x57000000,3,0,0x57207a00,2,1 38 | 0x57207a00,0,0,0x57000000,1,0=0x57207a00,0,0,0x57207a00,2,0 39 | 0x57207a00,2,1,0x57000000,1,0=0x57207a00,2,1,0x57207a00,0,1 40 | 0x57207a00,0,0,0x57000000,3,0=0x57207a00,0,0,0x57207a00,2,0 41 | 0x57207a00,2,1,0x57000000,3,0=0x57207a00,2,1,0x57207a00,0,1 42 | ; 43 | 0x57207a00,0,0,0x57600400,3,0=0x57207a00,0,0,0x57207a00,2,0 44 | 0x57207a00,2,1,0x57600400,1,0=0x57207a00,2,1,0x57207a00,0,1 45 | 0x57207a00,0,0,0x57602400,3,1=0x57207a00,0,0,0x57207a00,2,0 46 | 0x57207a00,2,1,0x57602400,1,0=0x57207a00,2,1,0x57207a00,0,1 47 | 0x57207a00,1,1,0x57000500,3,1=0x57207a00,1,1,0x57200200,2,0 48 | 0x57207a00,3,0,0x57000500,1,0=0x57207a00,3,0,0x57200200,1,0; conflicting-override 49 | 0x57207a00,1,1,0x57602400,2,0=0x57207a00,1,1,0x57207a00,3,1 50 | 0x57207a00,3,0,0x57602400,0,1=0x57207a00,3,0,0x57207a00,1,0 -------------------------------------------------------------------------------- /Lite Controller/RUL1/99_AllowedOverrides.txt: -------------------------------------------------------------------------------- 1 | [AllowedOverrides] 2 | ;Additional Overrides by Tropod. 3 | ;Overrides that are commented out either don't work properly, already exist, or just seem pointless. Some overrides have been commented out purposely. 4 | ;Overrides are also read in reverse, unfortunately. 5 | ; 6 | ;1=DirtRoad,Street 7 | ;2=DirtRoad,Road 8 | ;3=DirtRoad,OneWayRoad 9 | 4=DirtRoad,Avenue 10 | 5=DirtRoad,GroundHighway 11 | 6=DirtRoad,Highway 12 | 7=DirtRoad,Rail 13 | 8=DirtRoad,LightRail 14 | 9=DirtRoad,MonoRail 15 | ;10=Street,DirtRoad 16 | ;11=Street,Road 17 | ;12=Street,OneWayRoad 18 | ;13=Street,Avenue 19 | ;14=Street,GroundHighway 20 | ;15=Street,Highway 21 | ;16=Street,Rail 22 | ;17=Street,LightRail 23 | ;18=Street,Monorail 24 | ;19=Road,DirtRoad 25 | 20=Road,Street 26 | 21=Road,OneWayRoad 27 | ;22=Road,Avenue 28 | ;23=Road,GroundHighway 29 | ;24=Road,Highway 30 | ;25=Road,Rail 31 | ;26=Road,LightRail 32 | ;27=Road,MonoRail 33 | ;28=OneWayRoad,DirtRoad 34 | 29=OneWayRoad,Street 35 | 30=OneWayRoad,Road 36 | ;31=OneWayRoad,Avenue 37 | ;32=OneWayRoad,GroundHighway 38 | ;33=OneWayRoad,Highway 39 | ;34=OneWayRoad,Rail 40 | ;35=OneWayRoad,LightRail 41 | ;36=OneWayRoad,MonoRail 42 | ;37=Avenue,DirtRoad 43 | 38=Avenue,Street 44 | 39=Avenue,Road 45 | 40=Avenue,OneWayRoad 46 | ;41=Avenue,GroundHighway 47 | ;42=Avenue,Highway 48 | ;43=Avenue,Rail 49 | ;44=Avenue,LightRail 50 | ;45=Avenue,Monorail 51 | ;46=GroundHighway,DirtRoad 52 | 47=GroundHighway,Street 53 | 48=GroundHighway,Road 54 | 49=GroundHighway,OneWayRoad 55 | 50=GroundHighway,Avenue 56 | 51=GroundHighway,Highway 57 | 52=GroundHighway,Rail 58 | 53=GroundHighway,LightRail 59 | 54=GroundHighway,MonoRail 60 | ;55=Highway,DirtRoad 61 | 56=Highway,Street 62 | 57=Highway,Road 63 | 58=Highway,OneWayRoad 64 | 59=Highway,Avenue 65 | 60=Highway,GroundHighway 66 | 61=Highway,Rail 67 | 62=Highway,LightRail 68 | 63=Highway,MonoRail 69 | ;64=Rail,DirtRoad 70 | 65=Rail,Street 71 | 66=Rail,Road 72 | 67=Rail,OneWayRoad 73 | 68=Rail,Avenue 74 | 69=Rail,GroundHighway 75 | ;70=Rail,Highway 76 | ;71=Rail,LightRail 77 | ;72=Rail,MonoRail 78 | ;73=LightRail,DirtRoad 79 | 74=LightRail,Street 80 | 75=LightRail,Road 81 | 76=LightRail,OneWayRoad 82 | 77=LightRail,Avenue 83 | 78=LightRail,GroundHighway 84 | 79=LightRail,Highway 85 | 80=LightRail,Rail 86 | 81=LightRail,MonoRail 87 | ;82=MonoRail,DirtRoad 88 | 83=MonoRail,Street 89 | 84=MonoRail,Road 90 | 85=MonoRail,OneWayRoad 91 | 86=MonoRail,Avenue 92 | 87=MonoRail,GroundHighway 93 | 88=MonoRail,Highway 94 | 89=MonoRail,Rail 95 | 90=MonoRail,LightRail 96 | 91=Rail,Subway 97 | 92=Street,Subway 98 | -------------------------------------------------------------------------------- /Controller/RUL2/11_Rail/Sec11k_RRW_ParallelNetworkSupport.txt: -------------------------------------------------------------------------------- 1 | ;### next file: Sec11k_RRW_ParallelNetworkFix.txt ### 2 | ;### Added by MGB, last modified: May 29 13:42:00 UTC 2017 ### 3 | ;El-Rail 4 | 0x5D540500,3,0,0x08dd0300,2,0=0x5D540500,3,0,0x5D54FF00,2,0; missing_paths 5 | 0x5D540500,1,1,0x08dd0300,0,1=0x5D540500,1,1,0x5D54FF00,0,1; missing_paths 6 | 0x5D540900,3,0,0x08dd0300,2,0=0x5D540900,3,0,0x5D54FF00,2,0; missing_paths 7 | 0x5D540900,1,1,0x08dd0300,0,1=0x5D540900,1,1,0x5D54FF00,0,1; missing_paths 8 | 0x5D541000,3,0,0x08dd0300,2,0=0x5D541000,3,0,0x5D54FF10,2,0; missing_paths 9 | 0x5D541000,1,1,0x08dd0300,0,1=0x5D541000,1,1,0x5D54FF10,0,1; missing_paths 10 | ;Mono 11 | 0x5D540500,3,0,0x0ddd0300,2,0=0x5D540500,3,0,0x5D54FE00,2,0; missing_paths 12 | 0x5D540500,1,1,0x0ddd0300,0,1=0x5D540500,1,1,0x5D54FE00,0,1; missing_paths 13 | 0x5D540900,3,0,0x0ddd0300,2,0=0x5D540900,3,0,0x5D54FE00,2,0; missing_paths 14 | 0x5D540900,1,1,0x0ddd0300,0,1=0x5D540900,1,1,0x5D54FE00,0,1; missing_paths 15 | 0x5D541000,3,0,0x0ddd0300,2,0=0x5D541000,3,0,0x5D54FE10,2,0; missing_paths 16 | 0x5D541000,1,1,0x0ddd0300,0,1=0x5D541000,1,1,0x5D54FE10,0,1; missing_paths 17 | ;HSR 18 | 0x5D540500,3,0,0x5ddd0300,2,0=0x5D540500,3,0,0x5D54FD00,2,0; missing_paths 19 | 0x5D540500,1,1,0x5ddd0300,0,1=0x5D540500,1,1,0x5D54FD00,0,1; missing_paths 20 | 0x5D540900,3,0,0x5ddd0300,2,0=0x5D540900,3,0,0x5D54FD00,2,0; missing_paths 21 | 0x5D540900,1,1,0x5ddd0300,0,1=0x5D540900,1,1,0x5D54FD00,0,1; missing_paths 22 | 0x5D541000,3,0,0x5ddd0300,2,0=0x5D541000,3,0,0x5D54FD10,2,0; missing_paths 23 | 0x5D541000,1,1,0x5ddd0300,0,1=0x5D541000,1,1,0x5D54FD10,0,1; missing_paths 24 | ;Stability xx00 25 | 0x0D031500,1,0,0x5D54FD00,3,0=0x5DD31500,1,0,0x5D54FD00,3,0; missing_paths 26 | 0x0D031500,1,1,0x5D54FD00,1,1=0x5DD31500,1,1,0x5D54FD00,1,1; missing_paths 27 | 0x5DD31500,1,0,0x5D54FE00,3,0=0x5DD31500,1,0,0x5D54FD00,3,0; missing_paths 28 | 0x5DD31500,1,1,0x5D54FE00,1,1=0x5DD31500,1,1,0x5D54FD00,1,1; missing_paths 29 | 0x0DDD0300,3,0,0x5D54FD00,1,0=0x5DDD0300,3,0,0x5D54FD00,1,0; missing_paths 30 | 0x0DDD0300,1,1,0x5D54FD00,3,1=0x5DDD0300,1,1,0x5D54FD00,3,1; missing_paths 31 | ; xx10 32 | 0x0D031500,1,0,0x5D54FD10,3,0=0x5DD31500,1,0,0x5D54FD10,3,0; missing_paths 33 | 0x0D031500,1,1,0x5D54FD10,1,1=0x5DD31500,1,1,0x5D54FD10,1,1; missing_paths 34 | 0x5DD31500,1,0,0x5D54FE10,3,0=0x5DD31500,1,0,0x5D54FD10,3,0; missing_paths 35 | 0x5DD31500,1,1,0x5D54FE10,1,1=0x5DD31500,1,1,0x5D54FD10,1,1; missing_paths 36 | 0x0DDD0300,3,0,0x5D54FD10,1,0=0x5DDD0300,3,0,0x5D54FD10,1,0; missing_paths 37 | 0x0DDD0300,1,1,0x5D54FD10,3,1=0x5DDD0300,1,1,0x5D54FD10,3,1; missing_paths 38 | -------------------------------------------------------------------------------- /ltext/sv/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: sv\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.3.1\n" 13 | 14 | msgctxt "2026960B-2A592FD1-5413B700" 15 | msgid "AvenuexGround Light Rail Puzzle Piece" 16 | msgstr "" 17 | 18 | msgctxt "2026960B-2A592FD1-5413C700" 19 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 20 | msgstr "" 21 | 22 | msgctxt "2026960B-2A592FD1-54192700" 23 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 24 | msgstr "" 25 | 26 | msgctxt "2026960B-2A592FD1-54193700" 27 | msgid "Straight Avenue OnSlope Puzzle Piece" 28 | msgstr "" 29 | 30 | msgctxt "2026960B-2A592FD1-54260130" 31 | msgid "Avenue Blank Terrain (no pylon)" 32 | msgstr "" 33 | 34 | msgctxt "2026960B-2A592FD1-54260800" 35 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 36 | msgstr "" 37 | 38 | msgctxt "2026960B-2A592FD1-5426E000" 39 | msgid "" 40 | "Roundabout Avenue 4x4\n" 41 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 42 | msgstr "" 43 | 44 | msgctxt "2026960B-2A592FD1-542B9540" 45 | msgid "Avenue 45-Curve" 46 | msgstr "" 47 | 48 | msgctxt "2026960B-2A592FD1-542B9550" 49 | msgid "Avenue 45-Curve (FLEX)" 50 | msgstr "" 51 | 52 | msgctxt "2026960B-2A592FD1-542BE000" 53 | msgid "Avenue 90-Curve" 54 | msgstr "" 55 | 56 | msgctxt "2026960B-2A592FD1-54300000" 57 | msgid "Avenue to Elevated Avenue - Long Transition" 58 | msgstr "" 59 | 60 | msgctxt "2026960B-2A592FD1-54300E00" 61 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 62 | msgstr "" 63 | 64 | msgctxt "2026960B-2A592FD1-54500000" 65 | msgid "Freeway Exit - Straight" 66 | msgstr "" 67 | 68 | msgctxt "2026960B-2A592FD1-54589520" 69 | msgid "Avenue x Street crossing with median" 70 | msgstr "" 71 | 72 | msgctxt "2026960B-2A592FD1-54600000" 73 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 74 | msgstr "" 75 | 76 | msgctxt "2026960B-2A592FD1-54600500" 77 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 78 | msgstr "" 79 | 80 | msgctxt "2026960B-2A592FD1-54600800" 81 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 82 | msgstr "" 83 | 84 | msgctxt "2026960B-2A592FD1-5f491505" 85 | msgid "Avenue 5x5 90 Degree Curve" 86 | msgstr "" 87 | -------------------------------------------------------------------------------- /ltext/pt/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: pt_BR\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.3.1\n" 13 | 14 | msgctxt "2026960B-2A592FD1-5413B700" 15 | msgid "AvenuexGround Light Rail Puzzle Piece" 16 | msgstr "" 17 | 18 | msgctxt "2026960B-2A592FD1-5413C700" 19 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 20 | msgstr "" 21 | 22 | msgctxt "2026960B-2A592FD1-54192700" 23 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 24 | msgstr "" 25 | 26 | msgctxt "2026960B-2A592FD1-54193700" 27 | msgid "Straight Avenue OnSlope Puzzle Piece" 28 | msgstr "" 29 | 30 | msgctxt "2026960B-2A592FD1-54260130" 31 | msgid "Avenue Blank Terrain (no pylon)" 32 | msgstr "" 33 | 34 | msgctxt "2026960B-2A592FD1-54260800" 35 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 36 | msgstr "" 37 | 38 | msgctxt "2026960B-2A592FD1-5426E000" 39 | msgid "" 40 | "Roundabout Avenue 4x4\n" 41 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 42 | msgstr "" 43 | 44 | msgctxt "2026960B-2A592FD1-542B9540" 45 | msgid "Avenue 45-Curve" 46 | msgstr "" 47 | 48 | msgctxt "2026960B-2A592FD1-542B9550" 49 | msgid "Avenue 45-Curve (FLEX)" 50 | msgstr "" 51 | 52 | msgctxt "2026960B-2A592FD1-542BE000" 53 | msgid "Avenue 90-Curve" 54 | msgstr "" 55 | 56 | msgctxt "2026960B-2A592FD1-54300000" 57 | msgid "Avenue to Elevated Avenue - Long Transition" 58 | msgstr "" 59 | 60 | msgctxt "2026960B-2A592FD1-54300E00" 61 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 62 | msgstr "" 63 | 64 | msgctxt "2026960B-2A592FD1-54500000" 65 | msgid "Freeway Exit - Straight" 66 | msgstr "" 67 | 68 | msgctxt "2026960B-2A592FD1-54589520" 69 | msgid "Avenue x Street crossing with median" 70 | msgstr "" 71 | 72 | msgctxt "2026960B-2A592FD1-54600000" 73 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 74 | msgstr "" 75 | 76 | msgctxt "2026960B-2A592FD1-54600500" 77 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 78 | msgstr "" 79 | 80 | msgctxt "2026960B-2A592FD1-54600800" 81 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 82 | msgstr "" 83 | 84 | msgctxt "2026960B-2A592FD1-5f491505" 85 | msgid "Avenue 5x5 90 Degree Curve" 86 | msgstr "" 87 | -------------------------------------------------------------------------------- /Controller/RUL2/01_Maxis_Misc/Sec1f_Avenue_Misc.txt: -------------------------------------------------------------------------------- 1 | ; diagonal transition from avenue to road (compact version) 2 | 0x5f47f100,0,0,0x04000200,2,0=0x5F47F100,0,0,0x5F47F200,0,0 3 | 0x5F47F100,2,0,0x00000A00,1,0=0x5F47F100,2,0,0x5F47F000,2,0 4 | ; mirror 5 | 0x5f47f100,2,1,0x04000200,3,0=0x5F47F100,2,1,0x5F47F200,2,1 6 | 0x5F47F100,0,1,0x00000A00,2,0=0x5F47F100,0,1,0x5F47F000,0,1 7 | 8 | ; diagonal transition from avenue to road (full version) 9 | ; row 1 (stub-to-stub initialize) 10 | 0x00000200,2,0,0x04004200,3,0=0x5F47F400,0,0,0x5F47F500,0,0 11 | 0x00000200,2,0,0x04004200,0,1=0x5F47F400,0,0,0x5F47F500,0,0 12 | ; stabilize 13 | 0x5F47F400,0,0,0x04004200,3,0=0x5F47F400,0,0,0x5F47F500,0,0 14 | 0x5F47F400,0,0,0x04004200,0,1=0x5F47F400,0,0,0x5F47F500,0,0 15 | 0x00000200,2,0,0x5F47F500,0,0=0x5F47F400,0,0,0x5F47F500,0,0 16 | ; mirror - covered by short transition code 17 | ; row 1 extend 18 | 0x5f47f500,0,0,0x04001000,0,1=0x5f47f500,0,0,0x5f47f600,0,0 19 | ; mirror 20 | 0x5f47f500,2,1,0x04001000,2,0=0x5f47f500,2,1,0x5f47f600,2,1 21 | ; row 2 col 1 from row 1 col 1 22 | 0x5f47f500,3,0,0x04001000,2,0=0x5f47f500,3,0,0x5f47f700,3,0 23 | ; mirror 24 | 0x5f47f500,1,1,0x04001000,0,1=0x5f47f500,1,1,0x5f47f700,1,1 25 | ; row 2 col 2 from row 1 col 2 26 | 0x5f47f600,3,0,0x04003800,1,0=0x5f47f600,3,0,0x5f47f800,3,0 27 | 0x5f47f600,3,0,0x04003800,3,0=0x5f47f600,3,0,0x5f47f800,3,0 28 | ; mirror 29 | 0x5f47f600,1,1,0x04003800,0,0=0x5f47f600,1,1,0x5f47f800,1,1 30 | 0x5f47f600,1,1,0x04003800,2,0=0x5f47f600,1,1,0x5f47f800,1,1 31 | ; row 2 extend 32 | 0x5f47f800,0,0,0x04000200,2,0=0x5f47f800,0,0,0x5f47f900,0,0 33 | ; mirror 34 | 0x5f47f800,2,1,0x04000200,3,0=0x5f47f800,2,1,0x5f47f900,2,1 35 | ; row 0 from row 1 36 | 0x5f47f400,1,0,0x00000a00,2,0=0x5f47f400,1,0,0x5f47f300,1,0 37 | ; mirror 38 | 0x5f47f400,3,1,0x00000a00,1,0=0x5f47f400,3,1,0x5f47f300,3,1 39 | 40 | ;----Diagonal Road x Orth Avenue-Short Fix---- 41 | 0x00000A00,3,0,0x5F473200,3,0=0x00000C00,3,0,0x5F473200,3,0 42 | 0x00000A00,0,0,0x5F473200,1,1=0x00000C00,1,1,0x5F473200,1,1 43 | 44 | ;----Diagonal Road x Diag Avenue-Short Fix (T74)---- 45 | 0x5F077400,3,0,0x04003800,0,0=0x5F077400,3,0,0x5F077409,0,0 46 | 0x5F077400,1,1,0x04003800,1,0=0x5F077400,1,1,0x5F077409,2,1 47 | 0x5F077400,3,0,0x04003800,2,0=0x5F077400,3,0,0x5F077409,0,0 48 | 0x5F077400,1,1,0x04003800,3,0=0x5F077400,1,1,0x5F077409,2,1 49 | 50 | ;----Diagonal One-Way Road x Diag Avenue-Short Fix (T74)---- 51 | 0x5F977400,3,0,0x04003800,0,0=0x5F977400,3,0,0x5F977409,0,0 52 | 0x5F977400,1,1,0x04003800,1,0=0x5F977400,1,1,0x5F977409,2,1 53 | 0x5F977400,3,0,0x04003800,2,0=0x5F977400,3,0,0x5F977409,0,0 54 | 0x5F977400,1,1,0x04003800,3,0=0x5F977400,1,1,0x5F977409,2,1 -------------------------------------------------------------------------------- /src/test/scala/scripts/SegmentOrientationCheckerSpec.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.scripts 2 | 3 | import org.scalatest.wordspec.AnyWordSpec 4 | import org.scalatest.matchers.should.Matchers 5 | import io.github.memo33.metarules.meta._ 6 | import com.sc4nam.module._ 7 | import syntax._, Implicits._, RotFlip._, Network._, Flags._, NetworkProperties._ 8 | 9 | class SegmentOrientationCheckerSpec extends AnyWordSpec with Matchers { 10 | 11 | "SegmentOrientationChecker" should { 12 | "detect wrong base orientations" in { 13 | SegmentOrientationChecker.isBaseOrientationDifferent(Avenue~WE, L1Avenue~WE).shouldBe(false) 14 | SegmentOrientationChecker.isBaseOrientationDifferent(Avenue~EW, L1Avenue~WE).shouldBe(true) 15 | SegmentOrientationChecker.isBaseOrientationDifferent(Avenue~NS, L1Avenue~WE).shouldBe(true) 16 | SegmentOrientationChecker.isBaseOrientationDifferent(Glr1~(0,2,2,2), Glr1~(2,2,0,2)).shouldBe(true) 17 | } 18 | "detect wrong segment reversal" in { 19 | SegmentOrientationChecker.hasSegmentReversal(Dirtroad~WE & Ard3~NS, Mis~WE & Ard3~SN).shouldBe(true) 20 | SegmentOrientationChecker.hasSegmentReversal(Avenue~WE & Road~NS, L1Avenue~EW & Road~NS).shouldBe(true) 21 | } 22 | "detect badly connected segments" in { 23 | SegmentOrientationChecker.areSegmentsBadlyConnected(Ave2~(11,0,2,0), Road~WS & Ard3~SE, null).shouldBe(true) 24 | SegmentOrientationChecker.areSegmentsBadlyConnected(L1Road~(11,0,2,0), Road~(0,2,2,2), null).shouldBe(true) 25 | } 26 | "avoid false positives" in { 27 | Seq[(Tile, Tile, Rule[IdTile])]( 28 | (Rhw4~WE & Mis~ES, Mis~NW & Dirtroad~EN, Rule(0x57127d05,0,0,0x5700aa00,2,0,0x57127d05,0,0,0x5712aa80,2,0)), 29 | (Rhw4~EW & Mis~EN, Mis~SW & Dirtroad~ES, Rule(0x57127d05,2,1,0x5700aa00,0,0,0x57127d05,2,1,0x5712aa80,0,1)), 30 | (Rhw4~WE & Mis~SE, Mis~WN & Dirtroad~EN, Rule(0x57127d85,0,0,0x5700aa00,2,0,0x57127d85,0,0,0x5712aa00,2,0)), 31 | (Rhw4~EW & Mis~NE, Mis~WS & Dirtroad~ES, Rule(0x57127d85,2,1,0x5700aa00,0,0,0x57127d85,2,1,0x5712aa00,0,1)), 32 | (Road~CW & Avenue~SN & Onewayroad~EC, Onewayroad~EW, Rule(0x04008800,0,0,0x09000300,3,0,0x04008900,2,0,0x09004b00,3,0)), 33 | ).foreach { case (t1, t2, rule) => 34 | SegmentOrientationChecker.areSegmentsBadlyConnected(t1, t2, rule).shouldBe(false) 35 | } 36 | } 37 | "detect unexpected rotations of same ID (and handle symmetries correctly)" in { 38 | SegmentOrientationChecker.isUnexpectedRerotation(Rail~SW, Rail~SW, IdTile(0x03001a00,0,1), IdTile(0x03001a00,1,0)).shouldBe(false) 39 | SegmentOrientationChecker.isUnexpectedRerotation(L2Dtr~WE & Rail~NE, L2Dtr~WE & Rail~NW, IdTile(0x5d774500,3,0), IdTile(0x5d774500,3,1)).shouldBe(true) 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Controller/INRULs/AvenueAdvanced/RUL0E_Avenue_Advanced_Lite.rul: -------------------------------------------------------------------------------- 1 | #Transmogrify 2 | 3 | ;NOTE; file has been modified and contains custom content 4 | ;Last Updated: 092512. 5 | 6 | ;currently no active code here for multi-types. 7 | ;an original item has been modified due to issue though. 8 | ;; 9 | ;; 10 | ; Start of Roundabout Section 11 | ; Added by memo on 3/31/07 12 | ; 13 | ;4x4 Avenue Roundabouts 14 | ; 15 | ;5f479000 16 | ; 17 | 1,2,0,2,4 18 | 2,1,2,0,2,4 19 | 2,5,3,0,0,1 20 | 2,9,0,0,1,3 21 | 3,0,0x5f479000,0,0 22 | ; 23 | 1,2,0,2,4 24 | 2,1,2,0,2,4 25 | 2,5,3,0,0,1 26 | 2,9,3,1,1,3 27 | 3,0,0x5f479000,0,0 28 | ; 29 | 1,2,0,2,4 30 | 2,1,2,1,2,4 31 | 2,5,3,0,0,1 32 | 2,9,0,1,1,3 33 | 3,0,0x5f479000,0,0 34 | ; 35 | 1,2,0,2,4 36 | 2,1,2,0,2,4 37 | 2,5,3,0,1,1 38 | 2,9,0,0,1,3 39 | 3,0,0x5f479000,0,0 40 | ; 41 | 1,2,0,2,4 42 | 2,1,2,0,2,4 43 | 2,5,3,0,1,1 44 | 2,9,3,1,1,3 45 | 3,0,0x5f479000,0,0 46 | ; 47 | 1,2,0,2,4 48 | 2,1,2,0,2,4 49 | 2,5,3,0,0,1 50 | 2,9,3,0,1,3 51 | 3,0,0x5f479000,0,0 52 | ; 53 | 1,2,0,2,4 54 | 2,1,2,1,2,4 55 | 2,5,3,0,1,1 56 | 2,9,0,1,1,3 57 | 3,0,0x5f479000,0,0 58 | ; 59 | 1,2,0,2,4 60 | 2,1,2,0,2,4 61 | 2,5,3,0,1,1 62 | 2,9,3,0,1,3 63 | 3,0,0x5f479000,0,0 64 | ; 65 | ;5f479400 66 | ; 67 | 1,2,0,2,4 68 | 2,1,2,0,2,4 69 | 2,5,3,3,1,1 70 | 2,9,0,0,1,3 71 | 3,0,0x5f479400,0,0 72 | ; 73 | 1,2,0,2,4 74 | 2,1,2,0,2,4 75 | 2,5,3,3,1,1 76 | 2,9,3,1,1,3 77 | 3,0,0x5f479400,0,0 78 | ; 79 | 1,2,0,2,4 80 | 2,1,2,1,2,4 81 | 2,5,3,3,1,1 82 | 2,9,0,1,1,3 83 | 3,0,0x5f479400,0,0 84 | ; 85 | 1,2,0,2,4 86 | 2,1,2,0,2,4 87 | 2,5,3,3,1,1 88 | 2,9,3,0,1,3 89 | 3,0,0x5f479400,0,0 90 | ;; 91 | ;; 92 | ; End of Roundabout Section 93 | ;--------------------------- 94 | ; 95 | ; 96 | ; 97 | ;Orth to Diag T 53 98 | 1,2,4,2,0 99 | 2,3,2,0,2,4 100 | 2,4,2,0,2,4 101 | 2,5,2,4,2,0 102 | 2,16,2,3,2,4 103 | ;line 17 added due to issue. 104 | 2,17,2,4,2,0 105 | 3,0,0x04005300,3,0 106 | 107 | ;Orth to Diag T 74 108 | 1,2,0,2,4 109 | 2,5,2,3,2,4 110 | 2,6,2,4,2,0 111 | 2,7,2,4,2,0 112 | 3,0,0x04007400,1,0 113 | 114 | ;Orth to Diag T 74 (alt) 115 | 1,0,2,4,2 116 | 2,3,3,1,4,2 117 | 2,4,4,0,0,2 118 | 2,5,4,2,3,2 119 | 3,0,0x04007400,0,0 120 | 121 | ;Orth to Diag 4 74 122 | 1,0,2,4,2 123 | 2,3,3,2,4,2 124 | 2,5,4,2,3,2 125 | 3,0,0x04007400,0,0 126 | 127 | ;start of clone logic for avenue solutions 128 | ;diag diag T piece 94 129 | 1,2,2,1,3 130 | 2,1,0,1,2,3 131 | 2,3,3,0,1,2 132 | 2,5,1,3,0,0 133 | 2,7,1,3,0,0 134 | 3,0,0x040C9400,0,0 135 | 136 | ;diag diag T offset piece 69 137 | 1,3,1,2,2 138 | 2,1,0,1,3,0 139 | 2,3,3,0,0,1 140 | 2,5,2,3,1,2 141 | 2,7,0,2,2,0 142 | 3,0,0x040C6900,0,0 143 | 144 | ;diagonal end stub smoothing 145 | 1,0,0,1,3 146 | 2,5,1,0,0,3 147 | 3,0,0x04001000,0,0 148 | 3,5,0x04004200,0,0 149 | -------------------------------------------------------------------------------- /Controller/RUL1/07_Monorail/10_Monorail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [MonoRailGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 2003 4 | ; 5 | TYPE1=0x00030100,0x03010000,0x0a200300,0,1 6 | TYPE2=0x03010000,0x01000003,0x0a200300,3,1 7 | TYPE3=0x01000003,0x00000301,0x0a200300,2,1 8 | TYPE4=0x00000301,0x00030100,0x0a200300,1,1 9 | TYPE5=0x00000301,0x01000003,0x0a200300,0,0 10 | TYPE6=0x00030100,0x00000301,0x0a200300,1,0 11 | TYPE7=0x03010000,0x00030100,0x0a200300,2,0 12 | TYPE8=0x01000003,0x03010000,0x0a200300,3,0 13 | ; 14 | ;piece 2004 15 | ; 16 | TYPE1=0x01000003,0x03010301,0x0a200400,3,0 17 | TYPE2=0x00000301,0x01030103,0x0a200400,0,0 18 | TYPE3=0x00030100,0x03010301,0x0a200400,1,0 19 | TYPE4=0x03010000,0x01030103,0x0a200400,2,0 20 | ; 21 | ;piece 2001 22 | ; 23 | TYPE1=0x01000003,0x02040200,0x0a200100,1,0 24 | TYPE2=0x00000301,0x04020002,0x0a200100,2,0 25 | TYPE3=0x00030100,0x02000204,0x0a200100,3,0 26 | TYPE4=0x03010000,0x00020402,0x0a200100,0,0 27 | TYPE5=0x03010000,0x02000204,0x0a200100,1,1 28 | TYPE6=0x01000003,0x00020402,0x0a200100,0,1 29 | TYPE7=0x00000301,0x02040200,0x0a200100,3,1 30 | TYPE8=0x00030100,0x04020002,0x0a200100,2,1 31 | ; 32 | ;piece 2002 33 | ; 34 | TYPE1=0x00030100,0x02040200,0x0a200200,3,0 35 | TYPE2=0x03010000,0x04020002,0x0a200200,0,0 36 | TYPE3=0x01000003,0x02000204,0x0a200200,1,0 37 | TYPE4=0x00000301,0x00020402,0x0a200200,2,0 38 | TYPE5=0x00000301,0x02000204,0x0a200200,3,1 39 | TYPE6=0x00030100,0x00020402,0x0a200200,2,1 40 | TYPE7=0x03010000,0x02040200,0x0a200200,1,1 41 | TYPE8=0x01000003,0x04020002,0x0a200200,0,1 42 | ; 43 | ;piece 2000 44 | ; 45 | TYPE1=0x00020002,0x02040200,0x0a200000,3,0 46 | TYPE2=0x02000200,0x04020002,0x0a200000,0,0 47 | TYPE3=0x00020002,0x02000204,0x0a200000,1,0 48 | TYPE4=0x02000200,0x00020402,0x0a200000,2,0 49 | ; 50 | ;piece 2006 51 | ; 52 | TYPE1=0x00020002,0x03010000,0x0a200600,1,1 53 | TYPE2=0x02000200,0x01000003,0x0a200600,0,1 54 | TYPE3=0x00020002,0x00000301,0x0a200600,3,1 55 | TYPE4=0x02000200,0x00030100,0x0a200600,2,1 56 | TYPE5=0x00020002,0x01000003,0x0a200600,1,0 57 | TYPE6=0x02000200,0x00000301,0x0a200600,2,0 58 | TYPE7=0x00020002,0x00030100,0x0a200600,3,0 59 | TYPE8=0x02000200,0x03010000,0x0a200600,0,0 60 | ; 61 | ;piece 2005 62 | ; 63 | TYPE1=0x00020002,0x03010301,0x0a200500,1,0 64 | TYPE2=0x02000200,0x01030103,0x0a200500,0,0 65 | TYPE5=0x00020002,0x01030103,0x0a200500,3,1 66 | TYPE6=0x02000200,0x03010301,0x0a200500,2,1 67 | ; 68 | ; 69 | ;Added 061105 ~ Tropod 70 | ;monorail + junction,diagonal groundhighway 71 | ;1 72 | TYPE1=0x02020202,0x03010000,0x5FD72800,0,0 73 | TYPE2=0x02020202,0x01000003,0x5FD72800,1,0 74 | TYPE3=0x02020202,0x00000301,0x5FD72800,2,0 75 | TYPE4=0x02020202,0x00030100,0x5FD72800,3,0 76 | ;monorail + junction,diagonal groundhighway 77 | ;2 78 | TYPE1=0x02020202,0x03010301,0x5FD72E00,0,0 79 | TYPE2=0x02020202,0x01030103,0x5FD72E00,1,0 80 | ; 81 | ; 82 | -------------------------------------------------------------------------------- /Controller/RUL1/06_Lightrail/10_Lightrail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [LightRailGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 1003 4 | ; 5 | TYPE1=0x00030100,0x03010000,0x0a100300,0,1 6 | TYPE2=0x03010000,0x01000003,0x0a100300,3,1 7 | TYPE3=0x01000003,0x00000301,0x0a100300,2,1 8 | TYPE4=0x00000301,0x00030100,0x0a100300,1,1 9 | TYPE5=0x00000301,0x01000003,0x0a100300,0,0 10 | TYPE6=0x00030100,0x00000301,0x0a100300,1,0 11 | TYPE7=0x03010000,0x00030100,0x0a100300,2,0 12 | TYPE8=0x01000003,0x03010000,0x0a100300,3,0 13 | ; 14 | ;piece 1004 15 | ; 16 | TYPE1=0x01000003,0x03010301,0x0a100400,3,0 17 | TYPE2=0x00000301,0x01030103,0x0a100400,0,0 18 | TYPE3=0x00030100,0x03010301,0x0a100400,1,0 19 | TYPE4=0x03010000,0x01030103,0x0a100400,2,0 20 | ; 21 | ;piece 1001 22 | ; 23 | TYPE1=0x01000003,0x02040200,0x0a100100,1,0 24 | TYPE2=0x00000301,0x04020002,0x0a100100,2,0 25 | TYPE3=0x00030100,0x02000204,0x0a100100,3,0 26 | TYPE4=0x03010000,0x00020402,0x0a100100,0,0 27 | TYPE5=0x03010000,0x02000204,0x0a100100,1,1 28 | TYPE6=0x01000003,0x00020402,0x0a100100,0,1 29 | TYPE7=0x00000301,0x02040200,0x0a100100,3,1 30 | TYPE8=0x00030100,0x04020002,0x0a100100,2,1 31 | ; 32 | ;piece 1002 33 | ; 34 | TYPE1=0x00030100,0x02040200,0x0a100200,3,0 35 | TYPE2=0x03010000,0x04020002,0x0a100200,0,0 36 | TYPE3=0x01000003,0x02000204,0x0a100200,1,0 37 | TYPE4=0x00000301,0x00020402,0x0a100200,2,0 38 | TYPE5=0x00000301,0x02000204,0x0a100200,3,1 39 | TYPE6=0x00030100,0x00020402,0x0a100200,2,1 40 | TYPE7=0x03010000,0x02040200,0x0a100200,1,1 41 | TYPE8=0x01000003,0x04020002,0x0a100200,0,1 42 | ; 43 | ;piece 1000 44 | ; 45 | TYPE1=0x00020002,0x02040200,0x0a100000,3,0 46 | TYPE2=0x02000200,0x04020002,0x0a100000,0,0 47 | TYPE3=0x00020002,0x02000204,0x0a100000,1,0 48 | TYPE4=0x02000200,0x00020402,0x0a100000,2,0 49 | ; 50 | ;piece 1006 51 | ; 52 | TYPE1=0x00020002,0x03010000,0x0a100600,1,1 53 | TYPE2=0x02000200,0x01000003,0x0a100600,0,1 54 | TYPE3=0x00020002,0x00000301,0x0a100600,3,1 55 | TYPE4=0x02000200,0x00030100,0x0a100600,2,1 56 | TYPE5=0x00020002,0x01000003,0x0a100600,1,0 57 | TYPE6=0x02000200,0x00000301,0x0a100600,2,0 58 | TYPE7=0x00020002,0x00030100,0x0a100600,3,0 59 | TYPE8=0x02000200,0x03010000,0x0a100600,0,0 60 | ; 61 | ;piece 1005 62 | ; 63 | TYPE1=0x00020002,0x03010301,0x0a100500,1,0 64 | TYPE2=0x02000200,0x01030103,0x0a100500,0,0 65 | TYPE5=0x00020002,0x01030103,0x0a100500,3,1 66 | TYPE6=0x02000200,0x03010301,0x0a100500,2,1 67 | ; 68 | ; 69 | ;Added 060905 ~ Tropod 70 | ;lightrail + junction, diagonal groundhighway 71 | ;1 72 | TYPE1=0x02020202,0x03010000,0x5F872800,0,0 73 | TYPE2=0x02020202,0x01000003,0x5F872800,1,0 74 | TYPE3=0x02020202,0x00000301,0x5F872800,2,0 75 | TYPE4=0x02020202,0x00030100,0x5F872800,3,0 76 | ;lightrail + junction, diagonal groundhighway 77 | ;2 78 | TYPE1=0x02020202,0x03010301,0x5F874A00,0,0 79 | TYPE2=0x02020202,0x01030103,0x5F874A00,1,0 80 | ; 81 | ; 82 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/07_Monorail/10_Monorail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [MonoRailGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 2003 4 | ; 5 | TYPE1=0x00030100,0x03010000,0x0a200300,0,1 6 | TYPE2=0x03010000,0x01000003,0x0a200300,3,1 7 | TYPE3=0x01000003,0x00000301,0x0a200300,2,1 8 | TYPE4=0x00000301,0x00030100,0x0a200300,1,1 9 | TYPE5=0x00000301,0x01000003,0x0a200300,0,0 10 | TYPE6=0x00030100,0x00000301,0x0a200300,1,0 11 | TYPE7=0x03010000,0x00030100,0x0a200300,2,0 12 | TYPE8=0x01000003,0x03010000,0x0a200300,3,0 13 | ; 14 | ;piece 2004 15 | ; 16 | TYPE1=0x01000003,0x03010301,0x0a200400,3,0 17 | TYPE2=0x00000301,0x01030103,0x0a200400,0,0 18 | TYPE3=0x00030100,0x03010301,0x0a200400,1,0 19 | TYPE4=0x03010000,0x01030103,0x0a200400,2,0 20 | ; 21 | ;piece 2001 22 | ; 23 | TYPE1=0x01000003,0x02040200,0x0a200100,1,0 24 | TYPE2=0x00000301,0x04020002,0x0a200100,2,0 25 | TYPE3=0x00030100,0x02000204,0x0a200100,3,0 26 | TYPE4=0x03010000,0x00020402,0x0a200100,0,0 27 | TYPE5=0x03010000,0x02000204,0x0a200100,1,1 28 | TYPE6=0x01000003,0x00020402,0x0a200100,0,1 29 | TYPE7=0x00000301,0x02040200,0x0a200100,3,1 30 | TYPE8=0x00030100,0x04020002,0x0a200100,2,1 31 | ; 32 | ;piece 2002 33 | ; 34 | TYPE1=0x00030100,0x02040200,0x0a200200,3,0 35 | TYPE2=0x03010000,0x04020002,0x0a200200,0,0 36 | TYPE3=0x01000003,0x02000204,0x0a200200,1,0 37 | TYPE4=0x00000301,0x00020402,0x0a200200,2,0 38 | TYPE5=0x00000301,0x02000204,0x0a200200,3,1 39 | TYPE6=0x00030100,0x00020402,0x0a200200,2,1 40 | TYPE7=0x03010000,0x02040200,0x0a200200,1,1 41 | TYPE8=0x01000003,0x04020002,0x0a200200,0,1 42 | ; 43 | ;piece 2000 44 | ; 45 | TYPE1=0x00020002,0x02040200,0x0a200000,3,0 46 | TYPE2=0x02000200,0x04020002,0x0a200000,0,0 47 | TYPE3=0x00020002,0x02000204,0x0a200000,1,0 48 | TYPE4=0x02000200,0x00020402,0x0a200000,2,0 49 | ; 50 | ;piece 2006 51 | ; 52 | TYPE1=0x00020002,0x03010000,0x0a200600,1,1 53 | TYPE2=0x02000200,0x01000003,0x0a200600,0,1 54 | TYPE3=0x00020002,0x00000301,0x0a200600,3,1 55 | TYPE4=0x02000200,0x00030100,0x0a200600,2,1 56 | TYPE5=0x00020002,0x01000003,0x0a200600,1,0 57 | TYPE6=0x02000200,0x00000301,0x0a200600,2,0 58 | TYPE7=0x00020002,0x00030100,0x0a200600,3,0 59 | TYPE8=0x02000200,0x03010000,0x0a200600,0,0 60 | ; 61 | ;piece 2005 62 | ; 63 | TYPE1=0x00020002,0x03010301,0x0a200500,1,0 64 | TYPE2=0x02000200,0x01030103,0x0a200500,0,0 65 | TYPE5=0x00020002,0x01030103,0x0a200500,3,1 66 | TYPE6=0x02000200,0x03010301,0x0a200500,2,1 67 | ; 68 | ; 69 | ;Added 061105 ~ Tropod 70 | ;monorail + junction,diagonal groundhighway 71 | ;1 72 | TYPE1=0x02020202,0x03010000,0x5FD72800,0,0 73 | TYPE2=0x02020202,0x01000003,0x5FD72800,1,0 74 | TYPE3=0x02020202,0x00000301,0x5FD72800,2,0 75 | TYPE4=0x02020202,0x00030100,0x5FD72800,3,0 76 | ;monorail + junction,diagonal groundhighway 77 | ;2 78 | TYPE1=0x02020202,0x03010301,0x5FD72E00,0,0 79 | TYPE2=0x02020202,0x01030103,0x5FD72E00,1,0 80 | ; 81 | ; 82 | -------------------------------------------------------------------------------- /Lite Controller/RUL1/06_Lightrail/10_Lightrail_GroundHighway.txt: -------------------------------------------------------------------------------- 1 | [LightRailGroundHighwayIntersectionSolutions] 2 | ; 3 | ;piece 1003 4 | ; 5 | TYPE1=0x00030100,0x03010000,0x0a100300,0,1 6 | TYPE2=0x03010000,0x01000003,0x0a100300,3,1 7 | TYPE3=0x01000003,0x00000301,0x0a100300,2,1 8 | TYPE4=0x00000301,0x00030100,0x0a100300,1,1 9 | TYPE5=0x00000301,0x01000003,0x0a100300,0,0 10 | TYPE6=0x00030100,0x00000301,0x0a100300,1,0 11 | TYPE7=0x03010000,0x00030100,0x0a100300,2,0 12 | TYPE8=0x01000003,0x03010000,0x0a100300,3,0 13 | ; 14 | ;piece 1004 15 | ; 16 | TYPE1=0x01000003,0x03010301,0x0a100400,3,0 17 | TYPE2=0x00000301,0x01030103,0x0a100400,0,0 18 | TYPE3=0x00030100,0x03010301,0x0a100400,1,0 19 | TYPE4=0x03010000,0x01030103,0x0a100400,2,0 20 | ; 21 | ;piece 1001 22 | ; 23 | TYPE1=0x01000003,0x02040200,0x0a100100,1,0 24 | TYPE2=0x00000301,0x04020002,0x0a100100,2,0 25 | TYPE3=0x00030100,0x02000204,0x0a100100,3,0 26 | TYPE4=0x03010000,0x00020402,0x0a100100,0,0 27 | TYPE5=0x03010000,0x02000204,0x0a100100,1,1 28 | TYPE6=0x01000003,0x00020402,0x0a100100,0,1 29 | TYPE7=0x00000301,0x02040200,0x0a100100,3,1 30 | TYPE8=0x00030100,0x04020002,0x0a100100,2,1 31 | ; 32 | ;piece 1002 33 | ; 34 | TYPE1=0x00030100,0x02040200,0x0a100200,3,0 35 | TYPE2=0x03010000,0x04020002,0x0a100200,0,0 36 | TYPE3=0x01000003,0x02000204,0x0a100200,1,0 37 | TYPE4=0x00000301,0x00020402,0x0a100200,2,0 38 | TYPE5=0x00000301,0x02000204,0x0a100200,3,1 39 | TYPE6=0x00030100,0x00020402,0x0a100200,2,1 40 | TYPE7=0x03010000,0x02040200,0x0a100200,1,1 41 | TYPE8=0x01000003,0x04020002,0x0a100200,0,1 42 | ; 43 | ;piece 1000 44 | ; 45 | TYPE1=0x00020002,0x02040200,0x0a100000,3,0 46 | TYPE2=0x02000200,0x04020002,0x0a100000,0,0 47 | TYPE3=0x00020002,0x02000204,0x0a100000,1,0 48 | TYPE4=0x02000200,0x00020402,0x0a100000,2,0 49 | ; 50 | ;piece 1006 51 | ; 52 | TYPE1=0x00020002,0x03010000,0x0a100600,1,1 53 | TYPE2=0x02000200,0x01000003,0x0a100600,0,1 54 | TYPE3=0x00020002,0x00000301,0x0a100600,3,1 55 | TYPE4=0x02000200,0x00030100,0x0a100600,2,1 56 | TYPE5=0x00020002,0x01000003,0x0a100600,1,0 57 | TYPE6=0x02000200,0x00000301,0x0a100600,2,0 58 | TYPE7=0x00020002,0x00030100,0x0a100600,3,0 59 | TYPE8=0x02000200,0x03010000,0x0a100600,0,0 60 | ; 61 | ;piece 1005 62 | ; 63 | TYPE1=0x00020002,0x03010301,0x0a100500,1,0 64 | TYPE2=0x02000200,0x01030103,0x0a100500,0,0 65 | TYPE5=0x00020002,0x01030103,0x0a100500,3,1 66 | TYPE6=0x02000200,0x03010301,0x0a100500,2,1 67 | ; 68 | ; 69 | ;Added 060905 ~ Tropod 70 | ;lightrail + junction, diagonal groundhighway 71 | ;1 72 | TYPE1=0x02020202,0x03010000,0x5F872800,0,0 73 | TYPE2=0x02020202,0x01000003,0x5F872800,1,0 74 | TYPE3=0x02020202,0x00000301,0x5F872800,2,0 75 | TYPE4=0x02020202,0x00030100,0x5F872800,3,0 76 | ;lightrail + junction, diagonal groundhighway 77 | ;2 78 | TYPE1=0x02020202,0x03010301,0x5F874A00,0,0 79 | TYPE2=0x02020202,0x01030103,0x5F874A00,1,0 80 | ; 81 | ; 82 | -------------------------------------------------------------------------------- /Controller/RUL1/99_AllowedOverrides.txt: -------------------------------------------------------------------------------- 1 | [AllowedOverrides] 2 | ;Additional Overrides by Tropod. 3 | ;Overrides that are commented out either don't work properly, already exist, or just seem pointless. Some overrides have been commented out purposely. 4 | ;Overrides are also read in reverse, unfortunately. 5 | ; 6 | ;1=DirtRoad,Street 7 | ; The overrides Dirtroad <> Road, Dirtroad <> OneWayRoad are enabled 8 | ; so that Road and OneWayRoad can cross the RHW tile adjacent to 9 | ; RHW On-Slope Transitions. That RHW tile has INRUL flags 0,4,0,4. -memo 10 | 2=DirtRoad,Road 11 | 3=DirtRoad,OneWayRoad 12 | 4=DirtRoad,Avenue 13 | 5=DirtRoad,GroundHighway 14 | 6=DirtRoad,Highway 15 | 7=DirtRoad,Rail 16 | 8=DirtRoad,LightRail 17 | 9=DirtRoad,MonoRail 18 | ;10=Street,DirtRoad 19 | ;11=Street,Road 20 | ;12=Street,OneWayRoad 21 | ;13=Street,Avenue 22 | ;14=Street,GroundHighway 23 | ;15=Street,Highway 24 | ;16=Street,Rail 25 | ;17=Street,LightRail 26 | ;18=Street,Monorail 27 | ;19=Road,DirtRoad 28 | 20=Road,Street 29 | 21=Road,OneWayRoad 30 | ;22=Road,Avenue 31 | ;23=Road,GroundHighway 32 | ;24=Road,Highway 33 | ;25=Road,Rail 34 | ;26=Road,LightRail 35 | ;27=Road,MonoRail 36 | ;28=OneWayRoad,DirtRoad 37 | 29=OneWayRoad,Street 38 | 30=OneWayRoad,Road 39 | ;31=OneWayRoad,Avenue 40 | ;32=OneWayRoad,GroundHighway 41 | ;33=OneWayRoad,Highway 42 | ;34=OneWayRoad,Rail 43 | ;35=OneWayRoad,LightRail 44 | ;36=OneWayRoad,MonoRail 45 | ;37=Avenue,DirtRoad 46 | 38=Avenue,Street 47 | 39=Avenue,Road 48 | 40=Avenue,OneWayRoad 49 | ;41=Avenue,GroundHighway 50 | ;42=Avenue,Highway 51 | ;43=Avenue,Rail 52 | ;44=Avenue,LightRail 53 | ;45=Avenue,Monorail 54 | ;46=GroundHighway,DirtRoad 55 | 47=GroundHighway,Street 56 | 48=GroundHighway,Road 57 | 49=GroundHighway,OneWayRoad 58 | 50=GroundHighway,Avenue 59 | 51=GroundHighway,Highway 60 | 52=GroundHighway,Rail 61 | 53=GroundHighway,LightRail 62 | 54=GroundHighway,MonoRail 63 | ;55=Highway,DirtRoad 64 | 56=Highway,Street 65 | 57=Highway,Road 66 | 58=Highway,OneWayRoad 67 | 59=Highway,Avenue 68 | 60=Highway,GroundHighway 69 | 61=Highway,Rail 70 | 62=Highway,LightRail 71 | 63=Highway,MonoRail 72 | ;64=Rail,DirtRoad 73 | 65=Rail,Street 74 | 66=Rail,Road 75 | 67=Rail,OneWayRoad 76 | 68=Rail,Avenue 77 | 69=Rail,GroundHighway 78 | ;70=Rail,Highway 79 | ;71=Rail,LightRail 80 | ;72=Rail,MonoRail 81 | ;73=LightRail,DirtRoad 82 | 74=LightRail,Street 83 | 75=LightRail,Road 84 | 76=LightRail,OneWayRoad 85 | 77=LightRail,Avenue 86 | 78=LightRail,GroundHighway 87 | 79=LightRail,Highway 88 | 80=LightRail,Rail 89 | 81=LightRail,MonoRail 90 | ;82=MonoRail,DirtRoad 91 | 83=MonoRail,Street 92 | 84=MonoRail,Road 93 | 85=MonoRail,OneWayRoad 94 | 86=MonoRail,Avenue 95 | 87=MonoRail,GroundHighway 96 | 88=MonoRail,Highway 97 | 89=MonoRail,Rail 98 | 90=MonoRail,LightRail 99 | 91=Rail,Subway 100 | 92=Street,Subway 101 | -------------------------------------------------------------------------------- /Controller/RUL2/02_Diagonal_Streets/Sec2a_Diagonal_Streets_Intersections.txt: -------------------------------------------------------------------------------- 1 | ;---------------------------------------------------------- 2 | ; 3 | ; Diagonal Streets 4 | ; 5 | ; Intersection Helper Rules 6 | ; 7 | ;---------------------------------------------------------- 8 | ; 9 | ;orth road, single diag street (T) 10 | 0x5f502100,0,0,0x5f500200,2,0=0x5f502100,0,0,0x5f500400,3,1 11 | 0x5f500200,3,0,0x5f502100,0,1=0x5f500400,3,0,0x5f502100,0,1 12 | ; 13 | ;orth onewayroad, diag street (T) 14 | 0x5f503500,0,0,0x5f500200,2,0=0x5f503500,0,0,0x5f500400,3,1 15 | 0x5f500200,3,0,0x5f503500,0,1=0x5f500400,3,0,0x5f503500,0,1 16 | ; 17 | ;orth rail, diag street 18 | 0x5f500200,3,0,0x5f502900,2,1=0x5f502a00,2,1,0x5f502900,2,1 19 | 0x5f502900,0,1,0x5f500200,1,0=0x5f502900,0,1,0x5f502a00,0,1 20 | ; 21 | ;orth avenue, single diag street (T) 22 | 0x5f502f00,0,0,0x5f500200,2,0=0x5f502f00,0,0,0x5f500400,3,1 23 | 0x5f500200,3,0,0x5f502f00,0,1=0x5f500400,3,0,0x5f502f00,0,1 24 | ; 25 | ;Street Orth x Road Diag T 26 | 0x00aa0c00,0,0,0x00000a00,2,0=0x00aa0c00,0,0,0x00aa0c80,0,0 27 | 0x00aa0c00,2,1,0x00000a00,1,0=0x00aa0c00,2,1,0x00aa0c80,2,1 28 | ; 29 | ;Street Diag x Road Diag T 30 | 0x5F504400,0,0,0x00000a00,2,0=0x5F504400,0,0,0x5F504500,0,0 31 | 0x5F504400,2,1,0x00000a00,1,0=0x5F504400,2,1,0x5F504500,2,1 32 | ;Stability 33 | 0x5F502400,0,0,0x00000a00,2,0=0x5F504400,0,0,0x5F504500,0,0 34 | 0x5F502400,2,1,0x00000a00,1,0=0x5F504400,2,1,0x5F504500,2,1 35 | ; 36 | ;Street Orth x Onewayroad Diag T 37 | 0x09aa0c00,0,0,0x09000a00,2,0=0x09aa0c00,0,0,0x09aa0c80,0,0 38 | 0x09aa0c00,2,1,0x09000a00,1,0=0x09aa0c00,2,1,0x09aa0c80,2,1 39 | ; 40 | ;Street Diag x Onewayroad Diag T 41 | 0x5F504600,0,0,0x09000a00,2,0=0x5F504600,0,0,0x5F504700,0,0 42 | 0x5F504600,2,1,0x09000a00,1,0=0x5F504600,2,1,0x5F504700,2,1 43 | ;Stability 44 | 0x5F503600,0,0,0x09000a00,2,0=0x5F504600,0,0,0x5F504700,0,0 45 | 0x5F503600,2,1,0x09000a00,1,0=0x5F504600,2,1,0x5F504700,2,1 46 | ; 47 | ;road corner x diag street away 48 | 0x5F072800,1,0,0x5F500200,2,0=0x5F072800,1,0,0x5F500400,3,1 49 | 0x5F072800,3,1,0x5F500200,1,0=0x5F072800,3,1,0x5F500400,1,0 50 | ; 51 | ;road corner x diag street hook back 52 | 0x5F072900,1,0,0x5F500200,1,0=0x5F072900,1,0,0x5F500400,1,0 53 | 0x5F072900,3,1,0x5F500200,2,0=0x5F072900,3,1,0x5F500400,3,1 54 | ; 55 | ; road corner, street ortho & street diag toward street 56 | 0x5F072600,1,0,0x5F500200,2,0=0x5F072600,1,0,0x5F500400,3,1; missing_paths 57 | 0x5F072600,3,1,0x5F500200,1,0=0x5F072600,3,1,0x5F500400,1,0; missing_paths 58 | ; 59 | ; road corner, street ortho & street diag toward road 60 | 0x5F072700,1,0,0x5F500200,1,0=0x5F072700,1,0,0x5F500400,1,0; missing_paths 61 | 0x5F072700,3,1,0x5F500200,2,0=0x5F072700,3,1,0x5F500400,3,1; missing_paths 62 | ; 63 | ; road T, street diag 64 | 0x5F072A00,1,0,0x5F500200,2,0=0x5F072A00,1,0,0x5F500400,3,1; missing_paths 65 | 0x5F072A00,3,1,0x5F500200,1,0=0x5F072A00,3,1,0x5F500400,1,0; missing_paths 66 | ; -------------------------------------------------------------------------------- /src/main/scala/module/RhwRuleGenerator.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import io.github.memo33.metarules.meta._, syntax._ 4 | import Network._, Flags._, Flag._, RotFlip._, Implicits._, group.SymGroup._ 5 | import NetworkProperties._ 6 | 7 | 8 | object RhwRuleGenerator { 9 | 10 | implicit class HeightLevel(val level: Int) extends AnyVal { 11 | def ~ (n: Network): Network = if (n == Dirtroad) { 12 | if (level > 0 && level <= 2) { 13 | Network(L1Rhw2.id + level - 1) 14 | } else { 15 | require(level == 0) 16 | Dirtroad 17 | } 18 | } else if (level == 0 && (n == L1Rhw2 || n == L2Rhw2)) { 19 | Dirtroad 20 | } else { 21 | require(n.height == 0) 22 | val m = Network(n.id + (level - n.height)) 23 | assert(m.height == level) 24 | m 25 | } 26 | } 27 | } 28 | 29 | class RhwRuleGenerator(var context: RuleTransducer.Context) extends RuleGenerator with Curve45Generator with CrossingGenerator { 30 | import RhwRuleGenerator._ 31 | 32 | def createMultiTileStarters(): Unit = { 33 | val g = 0 // ground level 34 | val heights = 0 to 2 35 | for (h <- heights if h != g) { 36 | // C networks 37 | val cMultis = Iterable(Rhw6c, Rhw8c, Rhw10c) 38 | for (m <- cMultis) { 39 | Rules += h~Rhw6cm~SN | g~m~SN | % | h~m~SN 40 | Rules += h~m~WE~EW | g~m~WE~EW | % | h~m~WE~EW // stability against starter-induced auto-L0 issues 41 | Rules += h~m~WE~EW | g~m~WC~CW | % | h~m~WC~CW // stability 42 | } 43 | // S networks 44 | val sMultis = Iterable(Rhw8s, Rhw10s, Rhw12s) 45 | for (m <- sMultis) { 46 | Rules += h~Rhw8sm~SN | g~m~SN | % | h~m~SN 47 | Rules += h~m~WE~EW | g~m~WE~EW | % | h~m~WE~EW // stability against starter-induced auto-L0 issues 48 | Rules += h~m~WE~EW | g~m~WC~CW | % | h~m~WC~CW // stability 49 | } 50 | createRules() 51 | } 52 | } 53 | 54 | def start(): Unit = { 55 | createMultiTileStarters() 56 | 57 | for (main <- RhwNetworks; base <- main.base) { 58 | Rules += main~WE | (base ~> main)~WE // ortho 59 | Rules += main~WE | (base ~> main)~WC // ortho stub 60 | withSharedDiagonals { 61 | Rules += main~SE~ES | (base ~> main)~WN~NW // diagonal 62 | } 63 | // curves 64 | createCurve45Rules(main) 65 | createCurve90Rules(main) 66 | 67 | // crossings (O×O, O×D, D×O, D×D) 68 | for (minor <- CrossingGenerator.crossingNetworksOf(main)) { 69 | createCrossingRules(main, minor) 70 | } 71 | } 72 | } 73 | } 74 | 75 | // Compile individually with `sbt "runMain com.sc4nam.module.CompileRhwCode"`. 76 | object CompileRhwCode extends AbstractMain { 77 | lazy val resolve: IdResolver = new MiscResolver orElse new RealRailwayResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver 78 | val generator = new RhwRuleGenerator(_) 79 | lazy val file = new java.io.File("target/RhwMetaGenerated_MANAGED.txt") 80 | } 81 | -------------------------------------------------------------------------------- /ltext/de/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "PO-Revision-Date: \n" 5 | "Last-Translator: \n" 6 | "Language-Team: \n" 7 | "Language: de\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | 12 | msgctxt "2026960B-2A592FD1-5413B700" 13 | msgid "AvenuexGround Light Rail Puzzle Piece" 14 | msgstr "Allee über Straßenbahn-Puzzleteil" 15 | 16 | msgctxt "2026960B-2A592FD1-5413C700" 17 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 18 | msgstr "Allee über diagonaler Straßenbahn-Puzzleteil" 19 | 20 | msgctxt "2026960B-2A592FD1-54192700" 21 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 22 | msgstr "Allee-Puzzleteil für Hänge - T-Kreuzung" 23 | 24 | msgctxt "2026960B-2A592FD1-54193700" 25 | msgid "Straight Avenue OnSlope Puzzle Piece" 26 | msgstr "Allee-Puzzleteil für Hänge - gerade" 27 | 28 | msgctxt "2026960B-2A592FD1-54260130" 29 | msgid "Avenue Blank Terrain (no pylon)" 30 | msgstr "Allee über unbebauten Gebiet (kein Pfeiler)" 31 | 32 | msgctxt "2026960B-2A592FD1-54260800" 33 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 34 | msgstr "Allee über unbebautem Gelände - Übergang Gerade zu Diagonale" 35 | 36 | msgctxt "2026960B-2A592FD1-5426E000" 37 | msgid "" 38 | "Roundabout Avenue 4x4\n" 39 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 40 | msgstr "Allee-Kreisel 4x4" 41 | 42 | msgctxt "2026960B-2A592FD1-542B9540" 43 | msgid "Avenue 45-Curve" 44 | msgstr "Allee mit sanfter 45°-Kurve" 45 | 46 | msgctxt "2026960B-2A592FD1-542B9550" 47 | msgid "Avenue 45-Curve (FLEX)" 48 | msgstr "Allee mit sanfter 45°-Kurve (FLEX)" 49 | 50 | msgctxt "2026960B-2A592FD1-542BE000" 51 | msgid "Avenue 90-Curve" 52 | msgstr "Allee mit sanfter 90°-Kurve" 53 | 54 | msgctxt "2026960B-2A592FD1-54300000" 55 | msgid "Avenue to Elevated Avenue - Long Transition" 56 | msgstr "" 57 | 58 | msgctxt "2026960B-2A592FD1-54300E00" 59 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 60 | msgstr "" 61 | 62 | msgctxt "2026960B-2A592FD1-54500000" 63 | msgid "Freeway Exit - Straight" 64 | msgstr "Alleeausfahrt gerade" 65 | 66 | msgctxt "2026960B-2A592FD1-54589520" 67 | msgid "Avenue x Street crossing with median" 68 | msgstr "" 69 | 70 | msgctxt "2026960B-2A592FD1-54600000" 71 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 72 | msgstr "Übergang gerader Allee auf 18.4 Grad schräg verlaufende Allee (3x5)" 73 | 74 | msgctxt "2026960B-2A592FD1-54600500" 75 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 76 | msgstr "Schräg verlaufende Allee - gerader Abschnitt (3x3)" 77 | 78 | msgctxt "2026960B-2A592FD1-54600800" 79 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 80 | msgstr "Übergang diagonaler Allee auf 18.4 Grad schräg verlaufende Allee (3x4)" 81 | 82 | msgctxt "2026960B-2A592FD1-5f491505" 83 | msgid "Avenue 5x5 90 Degree Curve" 84 | msgstr "" 85 | -------------------------------------------------------------------------------- /ltext/ko/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: ko_KR\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.4\n" 13 | 14 | msgctxt "2026960B-2A592FD1-5413B700" 15 | msgid "AvenuexGround Light Rail Puzzle Piece" 16 | msgstr "고가 애비뉴 :: 전차 교차" 17 | 18 | msgctxt "2026960B-2A592FD1-5413C700" 19 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 20 | msgstr "고가 애비뉴 :: 대각선 전차 교차" 21 | 22 | msgctxt "2026960B-2A592FD1-54192700" 23 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 24 | msgstr "고가 애비뉴 :: T자 경사-위" 25 | 26 | msgctxt "2026960B-2A592FD1-54193700" 27 | msgid "Straight Avenue OnSlope Puzzle Piece" 28 | msgstr "고가 애비뉴 :: 직선 경사-위" 29 | 30 | msgctxt "2026960B-2A592FD1-54260130" 31 | msgid "Avenue Blank Terrain (no pylon)" 32 | msgstr "고가 애비뉴 :: 직선 (기둥 없음)" 33 | 34 | msgctxt "2026960B-2A592FD1-54260800" 35 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 36 | msgstr "고가 애비뉴 :: 직선 <> 대각선 전환" 37 | 38 | msgctxt "2026960B-2A592FD1-5426E000" 39 | msgid "" 40 | "Roundabout Avenue 4x4\n" 41 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 42 | msgstr "" 43 | "애비뉴 회전교차로 4x4\n" 44 | "BLS BSC 회전교차로 필러(포장재)를 철거하고, 다른 것을 설치할 수 있습니다. FLUPs 지하도로를 회전교차로 밑에 건설하려면 그냥 두어야 합니다. 지하도로 방향은 빨간색 미리보기 선으로 나타납니다. 분수에 있는 벽의 방향과 같습니다." 45 | 46 | msgctxt "2026960B-2A592FD1-542B9540" 47 | msgid "Avenue 45-Curve" 48 | msgstr "애비뉴 :: 45도 곡선" 49 | 50 | msgctxt "2026960B-2A592FD1-542B9550" 51 | msgid "Avenue 45-Curve (FLEX)" 52 | msgstr "애비뉴 :: 45도 곡선 (유연FLEX)" 53 | 54 | msgctxt "2026960B-2A592FD1-542BE000" 55 | msgid "Avenue 90-Curve" 56 | msgstr "애비뉴 :: 90도 곡선" 57 | 58 | msgctxt "2026960B-2A592FD1-54300000" 59 | msgid "Avenue to Elevated Avenue - Long Transition" 60 | msgstr "애비뉴 <> 고가 애비뉴 (긴 전환)" 61 | 62 | msgctxt "2026960B-2A592FD1-54300E00" 63 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 64 | msgstr "고가 애비뉴 :: 대각선 경사-위" 65 | 66 | msgctxt "2026960B-2A592FD1-54500000" 67 | msgid "Freeway Exit - Straight" 68 | msgstr "고속도로 출구 :: 직선" 69 | 70 | msgctxt "2026960B-2A592FD1-54589520" 71 | msgid "Avenue x Street crossing with median" 72 | msgstr "애비뉴 :: 거리 교차 (중앙분리대 있음)" 73 | 74 | msgctxt "2026960B-2A592FD1-54600000" 75 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 76 | msgstr "분수 각도 애비뉴(FAAVE-4) :: 18.4도 짧은 곡선 (3x5)" 77 | 78 | msgctxt "2026960B-2A592FD1-54600500" 79 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 80 | msgstr "분수 각도 애비뉴(FAAVE-4) :: 직선 (3x3)" 81 | 82 | msgctxt "2026960B-2A592FD1-54600800" 83 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 84 | msgstr "분수 각도 애비뉴(FAAVE-4) :: 대각선으로 전환 (3x4)" 85 | 86 | msgctxt "2026960B-2A592FD1-5f491505" 87 | msgid "Avenue 5x5 90 Degree Curve" 88 | msgstr "애비뉴 :: 90도 곡선 (5x5)" 89 | -------------------------------------------------------------------------------- /Controller/RUL0/B000_Lightrail/BD00_GLRExtension.txt: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;GROUND LIGHTRAIL EXTENSION BUTTON SECTION 3 | ;GROUND LIGHTRAIL EXTENSION BUTTON SECTION 4 | RotationRing = BD00, 1BD00, 2BD00, 3BD00, 4BD00, 5BD00, 6BD00, 7BD00 ;Ground Light Rail Alt1 Straight Puzzle Piece - drag 5 | AddTypes = BD01, 1BD01, 2BD01, 3BD01, 4BD01, 5BD01, 6BD01, 7BD01 ;Ground Light Rail Alt2 Straight Puzzle Piece - drag 6 | 7 | ;###separator### 8 | 9 | [HighwayIntersectionInfo_0x0000BD00] 10 | ;Added by Chrisim 16 September 2010 11 | ;modified by memo 01/17/2013 for use with Vanishing Construction Lot 12 | ;Ground Light Rail Straight Alt1 Puzzle Piece - drag 13 | Piece = 0.0, -16.0, 0, 0, 0x5F888006 14 | PreviewEffect = preview_draggable_glr___011 15 | 16 | CellLayout =....... 17 | CellLayout =...Z... 18 | CellLayout =...a..< 19 | CellLayout =...^... 20 | 21 | CheckType = Z - lightrail: 0x02000200 22 | CheckType = a - lightrail: 0x02000200 Road: 0x00010300, 0xffffffff optional 23 | 24 | ConsLayout =........ 25 | ConsLayout =...+.... 26 | ConsLayout =.......< 27 | ConsLayout =...^.... 28 | 29 | AutoTileBase = 0x55387000 ; former 0x5F888000 30 | ReplacementIntersection = 0, 0 31 | PlaceQueryID = 0x5F888006 32 | Costs = 8 33 | [HighwayIntersectionInfo_0x0001BD00] 34 | CopyFrom = 0xBD00 35 | Rotate = 1 36 | [HighwayIntersectionInfo_0x0002BD00] 37 | CopyFrom = 0xBD00 38 | Rotate = 2 39 | [HighwayIntersectionInfo_0x0003BD00] 40 | CopyFrom = 0xBD00 41 | Rotate = 3 42 | ;rotation clones 43 | [HighwayIntersectionInfo_0x0004BD00] 44 | CopyFrom = 0xBD00 45 | [HighwayIntersectionInfo_0x0005BD00] 46 | CopyFrom = 0x1BD00 47 | [HighwayIntersectionInfo_0x0006BD00] 48 | CopyFrom = 0x2BD00 49 | [HighwayIntersectionInfo_0x0007BD00] 50 | CopyFrom = 0x3BD00 51 | 52 | [HighwayIntersectionInfo_0x0000BD01] 53 | ;Added by Chrisim 16 September 2010 54 | ;modified by memo 01/17/2013 for use with Vanishing Construction Lot 55 | ;Ground Light Rail Straight Alt2 Puzzle Piece - drag 56 | Piece = 0.0, -16.0, 0, 0, 0x5F88C006 57 | PreviewEffect = preview_draggable_glr___010 58 | 59 | CellLayout =....... 60 | CellLayout =...Z... 61 | CellLayout =...a..< 62 | CellLayout =...^... 63 | 64 | CheckType = Z - lightrail: 0x02000200 65 | CheckType = a - lightrail: 0x02000200 onewayroad: 0x00010300, 0xffffffff optional 66 | 67 | ConsLayout =........ 68 | ConsLayout =...+.... 69 | ConsLayout =.......< 70 | ConsLayout =...^.... 71 | 72 | AutoTileBase = 0x55387000 ; former 0x5F88C000 73 | ReplacementIntersection = 0, 0 74 | PlaceQueryID = 0x5F88C006 75 | Costs = 8 76 | [HighwayIntersectionInfo_0x0001BD01] 77 | CopyFrom = 0xBD01 78 | Rotate = 1 79 | [HighwayIntersectionInfo_0x0002BD01] 80 | CopyFrom = 0xBD01 81 | Rotate = 2 82 | [HighwayIntersectionInfo_0x0003BD01] 83 | CopyFrom = 0xBD01 84 | Rotate = 3 85 | ;rotation clones 86 | [HighwayIntersectionInfo_0x0004BD01] 87 | CopyFrom = 0xBD01 88 | [HighwayIntersectionInfo_0x0005BD01] 89 | CopyFrom = 0x1BD01 90 | [HighwayIntersectionInfo_0x0006BD01] 91 | CopyFrom = 0x2BD01 92 | [HighwayIntersectionInfo_0x0007BD01] 93 | CopyFrom = 0x3BD01 94 | 95 | 96 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/T03B_Avenue_ThruT_OxO.txt: -------------------------------------------------------------------------------- 1 | ;==Orthogonal Tile and Adjacencies (10)== 2 | ;------------------------- 3 | ;----L0 RHW-2 (0x5700)---- 4 | ;------------------------- 5 | ;covered by INRULs and Specials 6 | ;------------------ 7 | ;---END L0 RHW-2--- 8 | ;------------------ 9 | ;------------------------- 10 | ;----L0 RHW-3 (0x5701)---- 11 | ;------------------------- 12 | ;----Base Network---- 13 | ;00 to 00 (Orth) 14 | 0x57610380,3,1,0x57000000,1,0=0x57610380,3,1,0x57010000,1,0 15 | 0x57610380,3,1,0x57000000,3,0=0x57610380,3,1,0x57010000,1,0 16 | 0x57610380,1,0,0x57000000,1,0=0x57610380,1,0,0x57010000,3,0 17 | 0x57610380,1,0,0x57000000,3,0=0x57610380,1,0,0x57010000,3,0 18 | ;---END L0 RHW-3--- 19 | ;------------------ 20 | 21 | ;------------------ 22 | ;----END L0 MIS---- 23 | ;------------------ 24 | ;------------------------- 25 | ;----L0 RHW-4 (0x5703)---- 26 | ;------------------------- 27 | ;----Base Network---- 28 | ;00 to 00 (Orth) 29 | 0x57630380,3,1,0x57000000,1,0=0x57630380,3,1,0x57030000,1,0 30 | 0x57630380,3,1,0x57000000,3,0=0x57630380,3,1,0x57030000,1,0 31 | 0x57630380,1,0,0x57000000,1,0=0x57630380,1,0,0x57030000,3,0 32 | 0x57630380,1,0,0x57000000,3,0=0x57630380,1,0,0x57030000,3,0 33 | ;---END L0 RHW-4--- 34 | ;------------------ 35 | 36 | ;============L1============ 37 | ;------------------------- 38 | ;----L1 RHW-3 (0x5711)---- 39 | ;------------------------- 40 | ;----Base Network---- 41 | ;00 to 00 (Orth) 42 | 0x57610390,3,1,0x57000000,1,0=0x57610390,3,1,0x57110000,1,0 43 | 0x57610390,3,1,0x57000000,3,0=0x57610390,3,1,0x57110000,1,0 44 | 0x57610390,1,0,0x57000000,1,0=0x57610390,1,0,0x57110000,3,0 45 | 0x57610390,1,0,0x57000000,3,0=0x57610390,1,0,0x57110000,3,0 46 | ;---END L1 RHW-3--- 47 | ;------------------ 48 | 49 | ;------------------------- 50 | ;----L1 RHW-4 (0x5713)---- 51 | ;------------------------- 52 | ;----Base Network---- 53 | ;00 to 00 (Orth) 54 | 0x57630390,3,1,0x57000000,1,0=0x57630390,3,1,0x57130000,1,0 55 | 0x57630390,3,1,0x57000000,3,0=0x57630390,3,1,0x57130000,1,0 56 | 0x57630390,1,0,0x57000000,1,0=0x57630390,1,0,0x57130000,3,0 57 | 0x57630390,1,0,0x57000000,3,0=0x57630390,1,0,0x57130000,3,0 58 | ;---END L1 RHW-4--- 59 | ;------------------ 60 | 61 | ;============L2============ 62 | ;------------------------- 63 | ;----L2 RHW-3 (0x5721)---- 64 | ;------------------------- 65 | ;----Base Network---- 66 | ;00 to 00 (Orth) 67 | 0x576103A0,3,1,0x57000000,1,0=0x576103A0,3,1,0x57210000,1,0 68 | 0x576103A0,3,1,0x57000000,3,0=0x576103A0,3,1,0x57210000,1,0 69 | 0x576103A0,1,0,0x57000000,1,0=0x576103A0,1,0,0x57210000,3,0 70 | 0x576103A0,1,0,0x57000000,3,0=0x576103A0,1,0,0x57210000,3,0 71 | ;---END L2 RHW-3--- 72 | ;------------------ 73 | 74 | ;------------------------- 75 | ;----L2 RHW-4 (0x5723)---- 76 | ;------------------------- 77 | ;----Base Network---- 78 | ;00 to 00 (Orth) 79 | 0x576303A0,3,1,0x57000000,1,0=0x576303A0,3,1,0x57230000,1,0 80 | 0x576303A0,3,1,0x57000000,3,0=0x576303A0,3,1,0x57230000,1,0 81 | 0x576303A0,1,0,0x57000000,1,0=0x576303A0,1,0,0x57230000,3,0 82 | 0x576303A0,1,0,0x57000000,3,0=0x576303A0,1,0,0x57230000,3,0 83 | ;---END L2 RHW-4--- 84 | ;------------------ -------------------------------------------------------------------------------- /src/scripts/compile-release-controllers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script compiles the different variants of the NAM controller for 4 | # release, using the CLI of the controller compiler. 5 | # 6 | # Call it from the project root: 7 | # 8 | # ./src/scripts/compile-release-controllers.sh "" 9 | # 10 | # The LText files are updated with the concrete version information. 11 | # If the argument is missing, the LTexts default to just the timestamp, as usual: 12 | # 13 | # ./src/scripts/compile-release-controllers.sh 14 | # 15 | # The compiled controllers are located at `./target/controllers/`. 16 | # The selections for Full/Low-RAM variants are taken from these files: 17 | # src/scripts/RUL2_IID_structure_full.xml 18 | # src/scripts/RUL2_IID_structure_noRHW.xml 19 | set -e 20 | 21 | if [ ! -e "Controller" ] 22 | then 23 | echo "Call this script from the root directory of the Network-Addon-Mod repository." 24 | exit 1 25 | fi 26 | 27 | PROJECT_ROOT="$(pwd)" 28 | TEMP="target/controllers/temp" 29 | mkdir -p "$TEMP" 30 | 31 | COMPILER_ARCHIVE="target/NAMControllerCompiler_2.0.0.zip" 32 | COMPILER_URL="https://github.com/memo33/NAMControllerCompiler/releases/download/2.0.0/NAMControllerCompiler_2.0.0.zip" 33 | 34 | if [ ! -e "$COMPILER_ARCHIVE" ] 35 | then 36 | # download compiler if it does not yet exist 37 | curl -L "$COMPILER_URL" > "$COMPILER_ARCHIVE" 38 | fi 39 | echo "66fb918af3791d4e9f2ab04580e26863d7882fec16b4bdd571bdeeb340b6cfe5 $COMPILER_ARCHIVE" | sha256sum --check 40 | unzip -d "$TEMP" "$COMPILER_ARCHIVE" 41 | 42 | 43 | VERSION="$1" 44 | DRIVESIDE='XHD' 45 | VARIANT='' 46 | DATESTRING="$(date --utc)" 47 | ltext() { 48 | if [ ! -z "$VERSION" ] 49 | then 50 | # If an argument was passed to the script, the version is non-empty. 51 | printf "NAM Version $VERSION $DRIVESIDE $VARIANT compiled on $DATESTRING" 52 | else 53 | # Otherwise pass the empty string to the compiler. 54 | printf "" 55 | fi 56 | } 57 | 58 | 59 | # RHD 4GB Full 60 | VARIANT='(4GB Full)' 61 | DRIVESIDE='RHD' 62 | cp "src/scripts/RUL2_IID_structure_full.xml" "$TEMP/resources/xml/RUL2_IID_structure.xml" 63 | (cd "$TEMP" && java -jar NAMControllerCompiler.jar "$PROJECT_ROOT/Controller" '../@0=0 NAM Controller_RHD_4GB_Full' 1 "$(ltext)") 64 | 65 | # LHD 4GB Full 66 | VARIANT='(4GB Full)' 67 | DRIVESIDE='LHD' 68 | cp "src/scripts/RUL2_IID_structure_full.xml" "$TEMP/resources/xml/RUL2_IID_structure.xml" 69 | (cd "$TEMP" && java -jar NAMControllerCompiler.jar "$PROJECT_ROOT/Controller" '../@1-0 NAM Controller_LHD_4GB_Full' 0 "$(ltext)") 70 | 71 | # RHD no-RHW 72 | VARIANT='(Low-RAM no-RHW)' 73 | DRIVESIDE='RHD' 74 | cp "src/scripts/RUL2_IID_structure_noRHW.xml" "$TEMP/resources/xml/RUL2_IID_structure.xml" 75 | (cd "$TEMP" && java -jar NAMControllerCompiler.jar "$PROJECT_ROOT/Controller" '../@2-0 NAM Controller_RHD_LowRAM_NoRHW' 1 "$(ltext)") 76 | 77 | # LHD no-RHW 78 | VARIANT='(Low-RAM no-RHW)' 79 | DRIVESIDE='LHD' 80 | cp "src/scripts/RUL2_IID_structure_noRHW.xml" "$TEMP/resources/xml/RUL2_IID_structure.xml" 81 | (cd "$TEMP" && java -jar NAMControllerCompiler.jar "$PROJECT_ROOT/Controller" '../@3-0 NAM Controller_LHD_LowRAM_NoRHW' 0 "$(ltext)") 82 | 83 | rm -rf "$TEMP" 84 | -------------------------------------------------------------------------------- /src/main/scala/module/Main.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import java.io.{File, PrintWriter} 4 | import io.github.memo33.metarules.meta.{RotFlip, EquivRule, IdTile} 5 | import syntax.{RuleGenerator, IdResolver, RuleTransducer, Tile} 6 | 7 | /** Usage: Replace (in source code) `resolve` and `generator` by custom 8 | * implementation, optionally replace `file`, too. 9 | * Then call `sbt run` to execute. 10 | */ 11 | object Main extends AbstractMain { 12 | 13 | lazy val resolve: IdResolver = new RealRailwayResolver orElse new SamResolver orElse new MiscResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver 14 | val generator = new RhwRuleGenerator(_) 15 | lazy val file = new File("./Controller/RUL2/07_RHW/RhwMetaGenerated_MANAGED.txt") 16 | } 17 | 18 | abstract class AbstractMain { 19 | 20 | def resolve: IdResolver 21 | def generator: RuleTransducer.Context => RuleGenerator 22 | def file: File 23 | 24 | /** Wraps the resolver for more informative error messages. */ 25 | lazy val resolveSafely: IdResolver = new PartialFunction[Tile, IdTile] { 26 | def isDefinedAt(tile: Tile) = resolve.isDefinedAt(tile) 27 | def apply(tile: Tile) = try resolve.apply(tile) catch { 28 | case e: RuleTransducer.ResolutionFailed => throw e 29 | case scala.util.control.NonFatal(e) => throw new RuleTransducer.ResolutionFailed(tile, rule = None, reason = e, frame = None) 30 | } 31 | } 32 | 33 | private lazy val shouldIgnoreMirroredOrientations: Set[Int] = MirrorVariants.ignoreMirroredOrientations(resolve) 34 | 35 | def main(args: Array[String]): Unit = start() 36 | 37 | /** Creates a generator with a new context, runs its start method and outputs the resulting RUL2 code to file. */ 38 | def start(file: File = file, tileOrientationCache: RuleTransducer.TileOrientationCache = null): Unit = { 39 | if (tileOrientationCache == null) { 40 | RegenerateTileOrientationCache.withCache { cache => 41 | start(file, cache) 42 | } 43 | } else { 44 | val context = RuleTransducer.Context( 45 | resolve, // resolveSafely is not needed here as RuleGenerator and RuleTransducer wrap exceptions in ResolutionFailed exceptions anyway 46 | tileOrientationCache, 47 | MirrorVariants.preprocessor, 48 | ) 49 | val gen = generator(context) 50 | gen.start() 51 | // TODO to be revised, later, in order to make more efficient 52 | scala.util.Using.resource(new PrintWriter(file)) { printer => 53 | printer.println(";This file was generated automatically. DO NOT EDIT!") 54 | val seen = collection.mutable.Set.empty[EquivRule] // remember seen rules to avoid duplicates 55 | for (rule <- gen.queue if seen.add(new EquivRule(rule))) { 56 | printer.println(rule.toRul2String) 57 | } 58 | } 59 | // finally remove accumulated orientations that we want to ignore (like accidentally mirrored TLAs) 60 | tileOrientationCache.accum.mapValuesInPlace { (id, repr) => 61 | if (shouldIgnoreMirroredOrientations(id)) repr.filterNot(_.flipped) 62 | else repr 63 | } 64 | tileOrientationCache.accum.filterInPlace { (id, repr) => // remove from accum if equal to cache (so that regenerateTileOrientationCache stabilizes eventually) 65 | !tileOrientationCache.cache.get(id).contains(repr) 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Controller/RUL2/07_RHW/Sec7b_BaseNetwork/T09B_ARD-3_ThruT_OxO.txt: -------------------------------------------------------------------------------- 1 | ;==Orthogonal Tile and Adjacencies (10)== 2 | ;------------------------- 3 | ;----L0 RHW-2 (0x5700)---- 4 | ;------------------------- 5 | ;covered by INRULs and Specials 6 | ;------------------ 7 | ;---END L0 RHW-2--- 8 | ;------------------ 9 | ;------------------------- 10 | ;----L0 RHW-3 (0x5701)---- 11 | ;------------------------- 12 | ;----Base Network---- 13 | ;00 to 00 (Orth) 14 | 0x57610980,3,0,0x57000000,1,0=0x57610980,3,0,0x57010000,1,0; missing_paths 15 | 0x57610980,3,0,0x57000000,3,0=0x57610980,3,0,0x57010000,1,0; missing_paths 16 | 0x57610980,1,0,0x57000000,1,0=0x57610980,1,0,0x57010000,3,0; missing_paths 17 | 0x57610980,1,0,0x57000000,3,0=0x57610980,1,0,0x57010000,3,0; missing_paths 18 | ;---END L0 RHW-3--- 19 | ;------------------ 20 | 21 | ;------------------------- 22 | ;----L0 RHW-4 (0x5703)---- 23 | ;------------------------- 24 | ;----Base Network---- 25 | ;00 to 00 (Orth) 26 | 0x57630980,3,0,0x57000000,1,0=0x57630980,3,0,0x57030000,1,0; missing_paths 27 | 0x57630980,3,0,0x57000000,3,0=0x57630980,3,0,0x57030000,1,0; missing_paths 28 | 0x57630980,1,0,0x57000000,1,0=0x57630980,1,0,0x57030000,3,0; missing_paths 29 | 0x57630980,1,0,0x57000000,3,0=0x57630980,1,0,0x57030000,3,0; missing_paths 30 | ;---END L0 RHW-4--- 31 | ;------------------ 32 | 33 | ;============L1============ 34 | ;------------------------- 35 | ;----L1 RHW-3 (0x5711)---- 36 | ;------------------------- 37 | ;----Base Network---- 38 | ;00 to 00 (Orth) 39 | 0x57610999,3,0,0x57000000,1,0=0x57610999,3,0,0x57110000,1,0; missing_paths 40 | 0x57610999,3,0,0x57000000,3,0=0x57610999,3,0,0x57110000,1,0; missing_paths 41 | 0x57610999,1,0,0x57000000,1,0=0x57610999,1,0,0x57110000,3,0; missing_paths 42 | 0x57610999,1,0,0x57000000,3,0=0x57610999,1,0,0x57110000,3,0; missing_paths 43 | ;---END L1 RHW-3--- 44 | ;------------------ 45 | 46 | ;------------------------- 47 | ;----L1 RHW-4 (0x5713)---- 48 | ;------------------------- 49 | ;----Base Network---- 50 | ;00 to 00 (Orth) 51 | 0x57630999,3,0,0x57000000,1,0=0x57630999,3,0,0x57130000,1,0; missing_paths 52 | 0x57630999,3,0,0x57000000,3,0=0x57630999,3,0,0x57130000,1,0; missing_paths 53 | 0x57630999,1,0,0x57000000,1,0=0x57630999,1,0,0x57130000,3,0; missing_paths 54 | 0x57630999,1,0,0x57000000,3,0=0x57630999,1,0,0x57130000,3,0; missing_paths 55 | ;---END L1 RHW-4--- 56 | ;------------------ 57 | 58 | ;============L2============ 59 | ;------------------------- 60 | ;----L2 RHW-3 (0x5721)---- 61 | ;------------------------- 62 | ;----Base Network---- 63 | ;00 to 00 (Orth) 64 | 0x576109A9,3,0,0x57000000,1,0=0x576109A9,3,0,0x57210000,1,0; missing_paths 65 | 0x576109A9,3,0,0x57000000,3,0=0x576109A9,3,0,0x57210000,1,0; missing_paths 66 | 0x576109A9,1,0,0x57000000,1,0=0x576109A9,1,0,0x57210000,3,0; missing_paths 67 | 0x576109A9,1,0,0x57000000,3,0=0x576109A9,1,0,0x57210000,3,0; missing_paths 68 | ;---END L2 RHW-3--- 69 | ;------------------ 70 | 71 | ;------------------------- 72 | ;----L2 RHW-4 (0x5723)---- 73 | ;------------------------- 74 | ;----Base Network---- 75 | ;00 to 00 (Orth) 76 | 0x576309A9,3,0,0x57000000,1,0=0x576309A9,3,0,0x57230000,1,0; missing_paths 77 | 0x576309A9,3,0,0x57000000,3,0=0x576309A9,3,0,0x57230000,1,0; missing_paths 78 | 0x576309A9,1,0,0x57000000,1,0=0x576309A9,1,0,0x57230000,3,0; missing_paths 79 | 0x576309A9,1,0,0x57000000,3,0=0x576309A9,1,0,0x57230000,3,0; missing_paths 80 | ;---END L2 RHW-4--- 81 | ;------------------ -------------------------------------------------------------------------------- /ltext/fr/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "PO-Revision-Date: \n" 5 | "Last-Translator: \n" 6 | "Language-Team: \n" 7 | "Language: fr\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | 12 | msgctxt "2026960B-2A592FD1-5413B700" 13 | msgid "AvenuexGround Light Rail Puzzle Piece" 14 | msgstr "Avenue X Tram (GLR) - Pièce-Puzzle" 15 | 16 | msgctxt "2026960B-2A592FD1-5413C700" 17 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 18 | msgstr "Avenue X Tram diagonal (GLR) - Pièce-Puzzle" 19 | 20 | msgctxt "2026960B-2A592FD1-54192700" 21 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 22 | msgstr "Intersection en T, Avenue sur versant - Pièce-Puzzle" 23 | 24 | msgctxt "2026960B-2A592FD1-54193700" 25 | msgid "Straight Avenue OnSlope Puzzle Piece" 26 | msgstr "Avenue sur versant - Pièce-Puzzle" 27 | 28 | msgctxt "2026960B-2A592FD1-54260130" 29 | msgid "Avenue Blank Terrain (no pylon)" 30 | msgstr "Avenue sur terrain vierge (sans pilier)" 31 | 32 | msgctxt "2026960B-2A592FD1-54260800" 33 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 34 | msgstr "Avenue sur terrain vierge - transition droite à diagonale" 35 | 36 | msgctxt "2026960B-2A592FD1-5426E000" 37 | msgid "" 38 | "Roundabout Avenue 4x4\n" 39 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 40 | msgstr "" 41 | "Rond-point d'avenue 4x4\n" 42 | "Vous pouvez raser le remplissage BLS-BSC et en placer un autre. Conservez-le si vous souhaitez créer un passage souterrain FLUPs sous le rond-point. Sa direction est indiquée par les lignes de prévisualisation rouges. Parallèle au mur de la fontaine." 43 | 44 | msgctxt "2026960B-2A592FD1-542B9540" 45 | msgid "Avenue 45-Curve" 46 | msgstr "Avenue courbe à 45°" 47 | 48 | msgctxt "2026960B-2A592FD1-542B9550" 49 | msgid "Avenue 45-Curve (FLEX)" 50 | msgstr "Avenue courbe à 45° (FLEX)" 51 | 52 | msgctxt "2026960B-2A592FD1-542BE000" 53 | msgid "Avenue 90-Curve" 54 | msgstr "Avenue courbe à 90°" 55 | 56 | msgctxt "2026960B-2A592FD1-54300000" 57 | msgid "Avenue to Elevated Avenue - Long Transition" 58 | msgstr "Avenue vers avenue surélevée - Longue rampe" 59 | 60 | msgctxt "2026960B-2A592FD1-54300E00" 61 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 62 | msgstr "Avenue en diagonale, sur versant - Pièce-Puzzle" 63 | 64 | msgctxt "2026960B-2A592FD1-54500000" 65 | msgid "Freeway Exit - Straight" 66 | msgstr "Autoroutes (Maxis), bretelles perpendiculaires" 67 | 68 | msgctxt "2026960B-2A592FD1-54589520" 69 | msgid "Avenue x Street crossing with median" 70 | msgstr "Avenue X Rue, avec terre-plein " 71 | 72 | msgctxt "2026960B-2A592FD1-54600000" 73 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 74 | msgstr "Avenue à angle fractionnaire (FAAVE-4) - 18.4° courbe courte (3x5)" 75 | 76 | msgctxt "2026960B-2A592FD1-54600500" 77 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 78 | msgstr "Avenue à angle fractionnaire (FAAVE-4) - Segment droit (3x3)" 79 | 80 | msgctxt "2026960B-2A592FD1-54600800" 81 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 82 | msgstr "Avenue diagonale vers angle fractionnaire (3x4)" 83 | 84 | msgctxt "2026960B-2A592FD1-5f491505" 85 | msgid "Avenue 5x5 90 Degree Curve" 86 | msgstr "Avenue courbe à 90° 5x5" 87 | -------------------------------------------------------------------------------- /src/test/scala/meta/RuleTransducerSpec.scala: -------------------------------------------------------------------------------- 1 | package io.github.memo33.metarules.meta 2 | 3 | import scala.collection.immutable.StringOps 4 | import org.scalatest.wordspec.AnyWordSpec 5 | import org.scalatest.matchers.should.Matchers 6 | import com.sc4nam.module, module.syntax._, Implicits._ 7 | import com.sc4nam.module.{NetworkProperties => NP} 8 | import group._, RotFlip._, SymGroup._, Network._, Flags._ 9 | import RuleTransducer._ 10 | 11 | class RuleTransducerSpec extends AnyWordSpec with Matchers { 12 | 13 | val resolver = new module.RhwResolver orElse new module.NwmResolver orElse new module.MiscResolver 14 | val context = RuleTransducer.Context(resolver, preprocess = module.MirrorVariants.preprocessor) 15 | 16 | "preprocessor" should { 17 | "produce expected number of rules for Tla3" in { 18 | val orth: Seq[Rule[SymTile]] = context.preprocess( Tla3~WE | (Road ~> Tla3)~WE ).toSeq 19 | orth should have size (1) 20 | orth.asInstanceOf[Seq[Rule[Tile]]].exists(_.exists(_.segs.exists(s => s.flags.manifest == Flag.RightSpinBi && s.flags.exists(_ == 2)))) should be (false) 21 | createRules(orth.head.map(_.toIdSymTile(resolver)), context.tileOrientationCache.cache, context.tileOrientationCache.accum).toSeq should have size (2) 22 | 23 | context.preprocess( Tla3~WE & Road~NS | (Road ~> Tla3)~WE ).toSeq should have size (1) 24 | val diag = context.preprocess( Tla3~WE & Road~WS | (Road ~> Tla3)~WE ).toSeq 25 | diag should have size (4) 26 | for (r <- diag) { 27 | createRules(r.map(_.toIdSymTile(resolver)), context.tileOrientationCache.cache, context.tileOrientationCache.accum).toSeq should have size (2) 28 | } 29 | } 30 | } 31 | 32 | "Resolver" should { 33 | "resolve left/right-spinned TLAs correctly" in { 34 | val tiles = Seq[Tile]( Tla3~WE & Road~ES, Tla3~WE & Ard3~ES, Tla3~WE & Tla3~ES ) 35 | val tile2 = Seq[Tile]( Tla3~WE, Tla3~WE & Road~NS, Tla3~WE & Ard3~NS, Tla3~WE & Tla3~NS ) 36 | for (t <- tiles) { 37 | resolver(NP.projectTlaLeft(t)) should not be resolver(NP.projectTlaRight(t)) 38 | } 39 | for (t <- tile2) { 40 | resolver(NP.projectTlaLeft(t)) should be (resolver(NP.projectTlaRight(t))) 41 | } 42 | } 43 | "handle flipped left/right-spinned TLAs correctly" in { 44 | val (t1, t2) = ( Tla3~WE & Road~ES, Tla3~WE & Road~WS ) 45 | resolver(NP.projectTlaLeft(t1)).id should not be (resolver(NP.projectTlaLeft(t2)).id) 46 | for ((t, i) <- Seq(t1, t2).zipWithIndex) { 47 | NP.projectTlaLeft(t).toIdSymTile(resolver).repr.filter(_.flipped ^ (i!=0)) should be (Symbol("empty")) 48 | NP.projectTlaRight(t).toIdSymTile(resolver).repr.filter(!_.flipped ^ (i!=0)) should be (Symbol("empty")) 49 | } 50 | } 51 | "find RHS for TLA" in { 52 | val rule = (Tla3~WE | (Road ~> Tla3)~(2,0,11,0)) map NP.projectTlaLeft map (_.toIdSymTile(resolver)) 53 | possibleMapOrientation(Set(R0F0, R1F0), R3F0/R2F1, Quotient.Dih4, R1F1/R2F1) should not be (Symbol("empty")) 54 | createRules(rule, context.tileOrientationCache.cache, context.tileOrientationCache.accum) 55 | } 56 | "resolve diagonal TLA intersections" in { 57 | val t1 = NP.projectTlaLeft(Tla3~ES & Road~WS) 58 | val t2 = NP.projectTlaRight(Tla3~ES & Road~WS) 59 | val t3 = NP.projectTlaLeft(Tla3~WS & Road~ES) 60 | resolver(t3) * R0F1 should be (resolver(t2)) 61 | resolver(t1).id should not be (resolver(t2).id) 62 | resolver(NP.projectTlaLeft(Tla3~ES & Tla3~WS)) should be (resolver(NP.projectTlaRight(Tla3~ES & Tla3~WS))) 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ltext/it/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: it\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 | "X-Generator: Poedit 3.3.1\n" 14 | 15 | msgctxt "2026960B-2A592FD1-5413B700" 16 | msgid "AvenuexGround Light Rail Puzzle Piece" 17 | msgstr "Puzzle di viale x ferrovia leggera terrestre" 18 | 19 | msgctxt "2026960B-2A592FD1-5413C700" 20 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 21 | msgstr "Puzzle di viale x ferrovia leggera terrestre diagonale" 22 | 23 | msgctxt "2026960B-2A592FD1-54192700" 24 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 25 | msgstr "Pezzo del puzzle \"T\" Avenue In Pendenza" 26 | 27 | msgctxt "2026960B-2A592FD1-54193700" 28 | msgid "Straight Avenue OnSlope Puzzle Piece" 29 | msgstr "Viale dritto in pendenza Pezzo di puzzle" 30 | 31 | msgctxt "2026960B-2A592FD1-54260130" 32 | msgid "Avenue Blank Terrain (no pylon)" 33 | msgstr "Viale Terreno vuoto (senza piloni)" 34 | 35 | msgctxt "2026960B-2A592FD1-54260800" 36 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 37 | msgstr "Viale su terreno vuoto - transizione da rettilineo a diagonale" 38 | 39 | msgctxt "2026960B-2A592FD1-5426E000" 40 | msgid "" 41 | "Roundabout Avenue 4x4\n" 42 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 43 | msgstr "" 44 | "Rotatoria Viale 4x4\n" 45 | "È possibile demolire il riempimento della rotatoria BLS BSC e metterne un altro. Mantenetelo se volete creare un sottopassaggio FLUPs sotto la rotatoria. La sua direzione è indicata dalle linee rosse di anteprima. È parallelo al muro della fontana." 46 | 47 | msgctxt "2026960B-2A592FD1-542B9540" 48 | msgid "Avenue 45-Curve" 49 | msgstr "Viale 45-Curva" 50 | 51 | msgctxt "2026960B-2A592FD1-542B9550" 52 | msgid "Avenue 45-Curve (FLEX)" 53 | msgstr "Viale 45-Curva (FLEX)" 54 | 55 | msgctxt "2026960B-2A592FD1-542BE000" 56 | msgid "Avenue 90-Curve" 57 | msgstr "Viale Curva 90" 58 | 59 | msgctxt "2026960B-2A592FD1-54300000" 60 | msgid "Avenue to Elevated Avenue - Long Transition" 61 | msgstr "Da viale a viale sopraelevato - Lunga transizione" 62 | 63 | msgctxt "2026960B-2A592FD1-54300E00" 64 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 65 | msgstr "Pezzo del puzzle Viale Diagonale in Pendenza" 66 | 67 | msgctxt "2026960B-2A592FD1-54500000" 68 | msgid "Freeway Exit - Straight" 69 | msgstr "Uscita autostradale - Diritto" 70 | 71 | msgctxt "2026960B-2A592FD1-54589520" 72 | msgid "Avenue x Street crossing with median" 73 | msgstr "Attraversamento stradale Viale x Via con mediana" 74 | 75 | msgctxt "2026960B-2A592FD1-54600000" 76 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 77 | msgstr "Viale ad angolo frazionato (FAAVE-4) - Curva corta di 18,4 gradi (3x5)" 78 | 79 | msgctxt "2026960B-2A592FD1-54600500" 80 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 81 | msgstr "Viale ad angolo frazionato (FAAVE-4) - Sezione rettilinea (3x3)" 82 | 83 | msgctxt "2026960B-2A592FD1-54600800" 84 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 85 | msgstr "Transizione da viale diagonale a viale ad angolo frazionato (3x4)" 86 | 87 | msgctxt "2026960B-2A592FD1-5f491505" 88 | msgid "Avenue 5x5 90 Degree Curve" 89 | msgstr "Viale Curva a 90 gradi 5x5" 90 | -------------------------------------------------------------------------------- /ltext/es/puzzlepieces-avenue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "PO-Revision-Date: \n" 5 | "Last-Translator: \n" 6 | "Language-Team: \n" 7 | "Language: es\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | 12 | msgctxt "2026960B-2A592FD1-5413B700" 13 | msgid "AvenuexGround Light Rail Puzzle Piece" 14 | msgstr "Pieza estática Avenida x Tren Ligero" 15 | 16 | msgctxt "2026960B-2A592FD1-5413C700" 17 | msgid "AvenuexDiagonal Ground Light Rail Puzzle Piece" 18 | msgstr "Pieza estática Avenida x Tren Ligero diagonal" 19 | 20 | msgctxt "2026960B-2A592FD1-54192700" 21 | msgid "\"T\" Avenue OnSlope Puzzle Piece" 22 | msgstr "Pieza estática cruce T de Avenida en talud" 23 | 24 | msgctxt "2026960B-2A592FD1-54193700" 25 | msgid "Straight Avenue OnSlope Puzzle Piece" 26 | msgstr "Pieza estática de Avenida en talud" 27 | 28 | msgctxt "2026960B-2A592FD1-54260130" 29 | msgid "Avenue Blank Terrain (no pylon)" 30 | msgstr "Pieza estática Viaducto de Avenida (sin pilar)" 31 | 32 | msgctxt "2026960B-2A592FD1-54260800" 33 | msgid "Avenue over Blank Terrain - transition straight to diagonal" 34 | msgstr "Pieza estática Viaducto de Avenida - transición ortogonal a diagonal" 35 | 36 | msgctxt "2026960B-2A592FD1-5426E000" 37 | msgid "" 38 | "Roundabout Avenue 4x4\n" 39 | "You can bulldoze the BLS BSC roundabout filler and plop another. Keep it if you wish to create a FLUPs underpass under the roundabout. Its direction is indicated by the red preview lines. It runs parallel with the wall in the fountain." 40 | msgstr "" 41 | "Rotonda de Avenida 4x4\n" 42 | "\n" 43 | "Se puede demoler el centro de rotonda BLS BSC y reemplazar por otro. Se debe mantener para usar un paso bajo nivel FLUP bajo la rotonda; la dirección de este paso está indicada por las líneas de la vista previa, y es paralela al muro de la fuente." 44 | 45 | msgctxt "2026960B-2A592FD1-542B9540" 46 | msgid "Avenue 45-Curve" 47 | msgstr "" 48 | "Curva de 45° para Avenida\n" 49 | "(pieza estática)" 50 | 51 | msgctxt "2026960B-2A592FD1-542B9550" 52 | msgid "Avenue 45-Curve (FLEX)" 53 | msgstr "" 54 | "Curva de 45° para Avenida\n" 55 | "(pieza FLEX)" 56 | 57 | msgctxt "2026960B-2A592FD1-542BE000" 58 | msgid "Avenue 90-Curve" 59 | msgstr "" 60 | "Curva de 90° para Avenida\n" 61 | "(pieza estática)" 62 | 63 | msgctxt "2026960B-2A592FD1-54300000" 64 | msgid "Avenue to Elevated Avenue - Long Transition" 65 | msgstr "Transición de altura larga para Avenida (L0-L2)" 66 | 67 | msgctxt "2026960B-2A592FD1-54300E00" 68 | msgid "Avenue Diagonal On-Slope Puzzle Piece" 69 | msgstr "Pieza estática de Avenida diagonal en talud" 70 | 71 | msgctxt "2026960B-2A592FD1-54500000" 72 | msgid "Freeway Exit - Straight" 73 | msgstr "Salida de autovía - ortogonal" 74 | 75 | msgctxt "2026960B-2A592FD1-54589520" 76 | msgid "Avenue x Street crossing with median" 77 | msgstr "Cruce Avenida x Calle con mediana" 78 | 79 | msgctxt "2026960B-2A592FD1-54600000" 80 | msgid "Fractionally Angled Avenue (FAAVE-4) - 18.4 Degree Short Curve (3x5)" 81 | msgstr "Avenida en diagonal intermedia (FAAVE-4) - Curva corta de 18,4° (3x5)" 82 | 83 | msgctxt "2026960B-2A592FD1-54600500" 84 | msgid "Fractionally Angled Avenue (FAAVE-4) - Straight Section (3x3)" 85 | msgstr "Avenida en diagonal intermedia (FAAVE-4) - Sección recta (3x3)" 86 | 87 | msgctxt "2026960B-2A592FD1-54600800" 88 | msgid "Diagonal to Fractionally Angled Avenue transition (3x4)" 89 | msgstr "Transición de Avenida diagonal a diagonal intermedia (FAAVE-4) (3x4)" 90 | 91 | msgctxt "2026960B-2A592FD1-5f491505" 92 | msgid "Avenue 5x5 90 Degree Curve" 93 | msgstr "" 94 | "Curva de 90° para Avenida\n" 95 | "(pieza FLEX, tamaño 5x5)" 96 | -------------------------------------------------------------------------------- /src/main/scala/module/onslope.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | /* The metarule code in this file is mostly self-contained and currently 3 | * covers orthogonal onslope transitions for RHW networks. 4 | */ 5 | 6 | import io.github.memo33.metarules.meta._ 7 | import syntax._, Network._, Flags._, RotFlip._, Implicits._, group.SymGroup._ 8 | import NetworkProperties._ 9 | import RhwRuleGenerator.HeightLevel 10 | 11 | trait Onslope { this: RuleGenerator & Curve45Generator => 12 | 13 | def createOnslopeTransition(): Unit = { 14 | // RHW OSTs 15 | val rhw2SlopeL1 = L1Rhw2~EC & Dirtroad~CW // IdTile(0x57700000,1,0, (Dirtroad~EC).symmetries) // direction East (upper) to West (lower) 16 | val rhw2SlopeL2 = L2Rhw2~EC & Dirtroad~CW // IdTile(0x57700100,1,0, (Dirtroad~EC).symmetries) // direction East (upper) to West (lower) 17 | for (main <- RhwNetworks - Rhw10c if main.height == 0) { 18 | val maxHeight = if ((Mis + Rhw4 + Rhw6s).contains(main)) 4 else 2 19 | val minHeight = if (main == Dirtroad) 1 else 0 // avoiding auto-L1Rhw2 and auto-L2Rhw2 20 | for { 21 | (levelDiff, rhw2Slope) <- Seq((1, rhw2SlopeL1), (2, rhw2SlopeL2)) // L1 vs L2 onslopes 22 | height <- minHeight to (maxHeight-levelDiff) 23 | } /*do*/ { 24 | val lower: Network = height~main 25 | val upper: Network = (height+levelDiff)~main 26 | val rhw2slope = (levelDiff~Dirtroad)~EC & Dirtroad~CW // direction East (upper) to West (lower) 27 | val onslope = upper~EC & lower~CW // direction East (upper) to West (lower) 28 | Rules += lower~EW | rhw2Slope | % | onslope // lower > OST 29 | Rules += onslope | (Dirtroad ~> upper)~EW // OST > upper 30 | Rules += rhw2Slope | upper~EW | onslope | % // OST < upper 31 | Rules += (Dirtroad ~> lower)~EW | onslope // lower < OST 32 | } 33 | } 34 | 35 | // Viaduct OSTs 36 | val viaductCombos = Seq( 37 | (Road, L1Road), 38 | (Road, L2Road), 39 | (L1Road, L2Road), // NOTE will suffer from auto-L1 issues 40 | (Onewayroad, L1Onewayroad), 41 | (Onewayroad, L2Onewayroad), 42 | (L1Onewayroad, L2Onewayroad), // NOTE will suffer from auto-L1 issues 43 | (Avenue, L1Avenue), 44 | (Avenue, L2Avenue), 45 | (L1Avenue, L2Avenue), // NOTE will suffer from auto-L1 issues 46 | ) 47 | for ((lower, upper) <- viaductCombos) { 48 | val onslope = upper~EC & lower~CW // direction East (upper) to West (lower) 49 | Rules += onslope | (upper.base.get ~> upper)~EW // OST > upper 50 | if (lower.height > 0) { 51 | assert(lower.height == 1) 52 | val baseOnslope = lower~EC & lower.base.get~CW 53 | Rules += baseOnslope | upper~EW | onslope | % // OST < upper 54 | Rules += lower~EW | baseOnslope | % | onslope // lower > OST 55 | Rules += (lower.base.get ~> lower)~EW | onslope // lower < OST 56 | // additionally attempt to raise auto-L1 to L2 57 | Rules += onslope | (lower ~> upper)~EW // OST > upper (from lower at L1) 58 | } 59 | } 60 | 61 | createRules() 62 | } 63 | } 64 | 65 | class OnslopeGenerator(var context: RuleTransducer.Context) extends RuleGenerator with Curve45Generator with Onslope { 66 | def start(): Unit = { 67 | createOnslopeTransition() 68 | } 69 | } 70 | 71 | // Compile individually with `sbt "runMain com.sc4nam.module.CompileOnslopeCode"`. 72 | object CompileOnslopeCode extends AbstractMain { 73 | lazy val resolve: IdResolver = new MiscResolver orElse new flexfly.FlexFlyResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver 74 | val generator = new OnslopeGenerator(_) 75 | lazy val file = new java.io.File("target/Sec7h0_OnslopeMetaGenerated_MANAGED.txt") 76 | } 77 | -------------------------------------------------------------------------------- /src/main/scala/module/SanityChecker.scala: -------------------------------------------------------------------------------- 1 | package com.sc4nam.module 2 | 3 | import java.nio.file.{Files, Paths, Path} 4 | import io.github.memo33.metarules.meta.{RotFlip, Rule, EquivRule, IdTile} 5 | import syntax.IdTile 6 | import Rul2Model.{iterateRulFiles, parseRule} 7 | 8 | /** Run with `sbt "runMain com.sc4nam.module.SanityChecker"`. 9 | */ 10 | object SanityChecker { 11 | 12 | val linePatternIncludingNewlines = "(?<=\n|\r(?!\n))" 13 | 14 | def main(args: Array[String]): Unit = { 15 | checkRedundantRul2() 16 | } 17 | 18 | /** Scans the Controller/RUL2/ folder for handwritten RUL2 code that is 19 | * superseded by metarule code. 20 | * 21 | * The respective lines are commented out and tagged as "; metaruled". 22 | * 23 | * Make sure all your changes to files are committed to git beforehand, 24 | * as this modifies files in place. 25 | * 26 | * Afterwards, you need to manually look through the changes and remove the 27 | * redundant code. 28 | */ 29 | def checkRedundantRul2(): Unit = { 30 | val seen = collection.mutable.Set.empty[EquivRule] 31 | 32 | // first cache all the RUL2 code generated by metarules 33 | LOGGER.info("caching RUL2 code generated by metarules") 34 | iterateRulFiles(Paths.get("target")).foreach { path => 35 | if (isMetaruleFile(path)) { 36 | scala.util.Using.resource(new java.util.Scanner(path.toFile(), "UTF-8")) { scanner => 37 | while(scanner.hasNextLine()) { 38 | parseRule(scanner.nextLine()).foreach { rule => 39 | seen.add(new EquivRule(rule)) 40 | } 41 | } 42 | } 43 | } 44 | } 45 | 46 | // then check handwritten RUL2 code for redundancies 47 | LOGGER.info("searching for redundant handwritten RUL2 code") 48 | iterateRulFiles(Paths.get("Controller/RUL2")).foreach { path => 49 | if (!isMetaruleFile(path)) { 50 | val tmpPath = path.resolveSibling(path.getFileName().toString() + ".tmp") 51 | val endsWithNewline = fileEndsWithNewline(path) // attempt to preserve missing newlines at end of files to avoid noise 52 | scala.util.Using.resources( 53 | new java.util.Scanner(path.toFile(), "UTF-8").useDelimiter(linePatternIncludingNewlines), 54 | new java.io.PrintWriter(tmpPath.toFile(), "UTF-8") 55 | ) { (lineScanner, printer) => 56 | while (lineScanner.hasNext()) { 57 | val line = lineScanner.next() 58 | if (parseRule(line).exists(rule => seen(new EquivRule(rule)))) { 59 | printer.println(s";${line.stripLineEnd}; metaruled") // comments out the line 60 | } else { 61 | printer.print(line) // preserving original linebreaks 62 | } 63 | } 64 | } 65 | Files.move(tmpPath, path, java.nio.file.StandardCopyOption.REPLACE_EXISTING) 66 | } 67 | } 68 | } 69 | 70 | // Choose here the metarule-generated code that the handwritten RUL2 code 71 | // should be compared to. 72 | val metaruleFiles = Set( 73 | "Sec7h0_OnslopeMetaGenerated_MANAGED.txt", 74 | // "Sec10e_GlrMetaGenerated_MANAGED.txt", 75 | ) 76 | 77 | def isMetaruleFile(path: Path): Boolean = { 78 | metaruleFiles.contains(path.getFileName().toString()) 79 | } 80 | 81 | def fileEndsWithNewline(path: Path): Boolean = { 82 | scala.util.Using.resource(new java.io.RandomAccessFile(path.toFile(), "r")) { raf => 83 | val size = Files.size(path) 84 | if (size > 0) { 85 | raf.seek(size - 1) 86 | val bytes = Array[Byte](0) 87 | raf.read(bytes) 88 | bytes(0) == 0x0a || bytes(0) == 0x0d // last byte matches \n or \r (assuming last character is ASCII) 89 | } else { // size == 0 90 | false 91 | } 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/Sec8h_NWM_MRC_Adjacency.txt: -------------------------------------------------------------------------------- 1 | ;(Adjacency for NWM Flex Multi Radius curves) 2 | ; 3 | ;Single Tile [TLA-3 -> AVE-2] Orthogonal 4 | ; 5 | 0x51010000,1,0,0x51000000,1,0=0x51010000,1,0,0x51010000,1,0 6 | 0x51010000,1,0,0x51000000,3,0=0x51010000,1,0,0x51010000,3,0 7 | 0x51010000,3,0,0x51000000,1,0=0x51010000,3,0,0x51010000,1,0 8 | 0x51010000,3,0,0x51000000,3,0=0x51010000,3,0,0x51010000,3,0 9 | ; 10 | ;Single Tile [TLA-3 -> AVE-2] Diagonal 11 | ; 12 | 0x51010200,0,0,0x51000200,2,0=0x51010200,0,0,0x51010200,2,0 13 | 0x51010200,0,0,0x51000200,2,0=0x51010200,0,0,0x51010200,2,0 14 | 0x51010200,3,0,0x51000200,1,0=0x51010200,3,0,0x51010200,1,0 15 | 0x51010200,3,0,0x51000200,1,0=0x51010200,3,0,0x51010200,1,0 16 | ; 17 | ; 18 | ;Single Tile [TLA-3 -> ARD-3] Orthogonal 19 | ; 20 | 0x51020000,1,0,0x51000000,1,0=0x51020000,1,0,0x51020000,1,0 21 | 0x51020000,1,0,0x51000000,3,0=0x51020000,1,0,0x51020000,1,0 22 | 0x51020000,3,0,0x51000000,1,0=0x51020000,3,0,0x51020000,3,0 23 | 0x51020000,3,0,0x51000000,3,0=0x51020000,3,0,0x51020000,3,0 24 | ; 25 | ;Single Tile [TLA-3 -> ARD-3] Diagonal 26 | ; 27 | 0x51020200,0,0,0x51000200,2,0=0x51020200,0,0,0x51020900,2,0 28 | 0x51020200,0,0,0x51000200,2,0=0x51020200,0,0,0x51020900,2,0 29 | 0x51020900,0,0,0x51000200,2,0=0x51020900,0,0,0x51020200,2,0 30 | 0x51020900,0,0,0x51000200,2,0=0x51020900,0,0,0x51020200,2,0 31 | ; 32 | 0x51020200,3,0,0x51000200,1,0=0x51020200,3,0,0x51020900,1,0 33 | 0x51020200,3,0,0x51000200,1,0=0x51020200,3,0,0x51020900,1,0 34 | 0x51020900,3,0,0x51000200,1,0=0x51020900,3,0,0x51020200,1,0 35 | 0x51020900,3,0,0x51000200,1,0=0x51020900,3,0,0x51020200,1,0 36 | ; 37 | ;Single Tile [TLA-3 -> NRD-4] Orthogonal 38 | ; 39 | 0x51050000,1,0,0x51000000,1,0=0x51050000,1,0,0x51050000,1,0 40 | 0x51050000,1,0,0x51000000,3,0=0x51050000,1,0,0x51050000,3,0 41 | 0x51050000,3,0,0x51000000,1,0=0x51050000,3,0,0x51050000,1,0 42 | 0x51050000,3,0,0x51000000,3,0=0x51050000,3,0,0x51050000,3,0 43 | ; 44 | ;Single Tile [TLA-3 -> NRD-4] Diagonal 45 | ; 46 | 0x51050200,0,0,0x51000200,2,0=0x51050200,0,0,0x51050200,2,0 47 | 0x51050200,0,0,0x51000200,2,0=0x51050200,0,0,0x51050200,2,0 48 | 0x51050200,3,0,0x51000200,1,0=0x51050200,3,0,0x51050200,1,0 49 | 0x51050200,3,0,0x51000200,1,0=0x51050200,3,0,0x51050200,1,0 50 | ; 51 | ;Single Tile [ARD-3 -> NRD-4] Orthogonal 52 | ; 53 | 0x51050000,1,0,0x51020000,1,0=0x51050000,1,0,0x51050000,1,0 54 | 0x51050000,3,0,0x51020000,1,0=0x51050000,3,0,0x51050000,3,0 55 | 0x51050000,1,0,0x51020000,3,0=0x51050000,1,0,0x51050000,1,0 56 | 0x51050000,3,0,0x51020000,3,0=0x51050000,3,0,0x51050000,3,0 57 | ; 58 | ;Single Tile [ARD-3 -> NRD-4] Diagonal 59 | ; 60 | 0x51050200,0,0,0x51020200,2,0=0x51050200,0,0,0x51050200,2,0 61 | 0x51050200,0,0,0x51020200,2,0=0x51050200,0,0,0x51050200,2,0 62 | 0x51050200,0,0,0x51020900,2,0=0x51050200,0,0,0x51050200,2,0 63 | 0x51050200,0,0,0x51020900,2,0=0x51050200,0,0,0x51050200,2,0 64 | 0x51050200,3,0,0x51020200,1,0=0x51050200,3,0,0x51050200,1,0 65 | 0x51050200,3,0,0x51020200,1,0=0x51050200,3,0,0x51050200,1,0 66 | 0x51050200,3,0,0x51020900,1,0=0x51050200,3,0,0x51050200,1,0 67 | 0x51050200,3,0,0x51020900,1,0=0x51050200,3,0,0x51050200,1,0 68 | ; 69 | ;Dual Tile [TLA-5 -> RD-6] Orthogonal 70 | ; 71 | 0x51140000,1,0,0x51100000,1,0=0x51140000,1,0,0x51140000,1,0 72 | 0x51140000,1,0,0x51100000,1,0=0x51140000,1,0,0x51140000,1,0 73 | 0x51140000,3,0,0x51100000,3,0=0x51140000,3,0,0x51140000,3,0 74 | 0x51140000,3,0,0x51100000,3,0=0x51140000,3,0,0x51140000,3,0 75 | ; 76 | ;Dual Tile [TLA-5 -> RD-6] Diagonal 77 | ; 78 | 0x51140300,0,0,0x51100300,2,0=0x51140300,0,0,0x51140300,2,0 79 | 0x51140300,3,0,0x51100300,1,0=0x51140300,3,0,0x51140300,1,0 80 | 0x51140300,1,0,0x51100200,1,0=0x51140300,1,0,0x51140200,1,0 81 | 0x51140300,2,0,0x51100200,2,0=0x51140300,2,0,0x51140200,2,0 82 | 0x51140200,0,0,0x51100300,0,0=0x51140200,0,0,0x51140300,0,0 83 | 0x51140200,3,0,0x51100300,3,0=0x51140200,3,0,0x51140300,3,0 84 | -------------------------------------------------------------------------------- /Controller/RUL0/F000_Special/F210_AdvancedBridges.txt: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;ADVANCED BRIDGES BUTTON SECTION 3 | ;ADVANCED BRIDGES BUTTON SECTION 4 | ; 0x0000#F21# 5 | 6 | RotationRing = F210, 1F210, 2F210, 3F210, 4F210, 5F210, 6F210, 7F210;(1) #3444-#3446 7 | AddTypes = F211, 1F211, 2F211, 3F211, 4F211, 5F211, 6F211, 7F211;(2) #344c-#344E 8 | AddTypes = F212, 1F212, 2F212, 3F212, 4F212, 5F212, 6F212, 7F212;(3) #344f-#3451 9 | 10 | ;###separator### 11 | 12 | ;Frank Werspuckle Memorial Bridge #3444 Start piece - RUL0 13 | [HighwayIntersectionInfo_0x0000F210] 14 | Piece = 0.0, -16.0, 0, 0, 0x5c160005 15 | PreviewEffect = preview_av_1_001 16 | 17 | CellLayout = ..a.. 18 | CellLayout = ..Z.< 19 | CellLayout = ..... 20 | CellLayout = ..^.. 21 | 22 | ;senw 23 | CheckType = Z - rail: 0x02000200 24 | CheckType = a - monorail: 0x01010000 rail: 0x02000200, 0xffffffff optional 25 | 26 | ConsLayout = ..X.. 27 | ConsLayout = ..#.< 28 | ConsLayout = ..#.. 29 | ConsLayout = ..^.. 30 | 31 | AutoTileBase = 0x55387000 32 | PlaceQueryID = 0x5f0f700f 33 | Costs = 600 34 | 35 | [HighwayIntersectionInfo_0x0001F210] 36 | CopyFrom = 0xF210 37 | Rotate = 1 38 | [HighwayIntersectionInfo_0x0002F210] 39 | CopyFrom = 0xF210 40 | Rotate = 2 41 | [HighwayIntersectionInfo_0x0003F210] 42 | CopyFrom = 0xF210 43 | Rotate = 3 44 | [HighwayIntersectionInfo_0x0004F210] 45 | CopyFrom = 0xF210 46 | [HighwayIntersectionInfo_0x0005F210] 47 | CopyFrom = 0x1F210 48 | [HighwayIntersectionInfo_0x0006F210] 49 | CopyFrom = 0x2F210 50 | [HighwayIntersectionInfo_0x0007F210] 51 | CopyFrom = 0x3F210 52 | 53 | ;Steel Overtruss #344c Start piece - RUL0 54 | [HighwayIntersectionInfo_0x0000F211] 55 | Piece = 0.0, -16.0, 0, 0, 0x5c160005 56 | PreviewEffect = preview_av_1_001 57 | 58 | CellLayout = ..a.. 59 | CellLayout = ..Z.< 60 | CellLayout = ..... 61 | CellLayout = ..^.. 62 | 63 | ;senw 64 | CheckType = Z - rail: 0x02000200 65 | CheckType = a - monorail: 0x03030000 rail: 0x02000200, 0xffffffff optional 66 | 67 | ConsLayout = ..X.. 68 | ConsLayout = ..#.< 69 | ConsLayout = ..#.. 70 | ConsLayout = ..^.. 71 | 72 | AutoTileBase = 0x55387000 73 | PlaceQueryID = 0x5f0f740f 74 | Costs = 600 75 | 76 | [HighwayIntersectionInfo_0x0001F211] 77 | CopyFrom = 0xF211 78 | Rotate = 1 79 | [HighwayIntersectionInfo_0x0002F211] 80 | CopyFrom = 0xF211 81 | Rotate = 2 82 | [HighwayIntersectionInfo_0x0003F211] 83 | CopyFrom = 0xF211 84 | Rotate = 3 85 | [HighwayIntersectionInfo_0x0004F211] 86 | CopyFrom = 0xF211 87 | [HighwayIntersectionInfo_0x0005F211] 88 | CopyFrom = 0x1F211 89 | [HighwayIntersectionInfo_0x0006F211] 90 | CopyFrom = 0x2F211 91 | [HighwayIntersectionInfo_0x0007F211] 92 | CopyFrom = 0x3F211 93 | 94 | ;Stone Arch #344f Start piece - RUL0 95 | [HighwayIntersectionInfo_0x0000F212] 96 | Piece = 0.0, -16.0, 0, 0, 0x5c160005 97 | PreviewEffect = preview_av_1_001 98 | 99 | CellLayout = ..a.. 100 | CellLayout = ..Z.< 101 | CellLayout = ..... 102 | CellLayout = ..^.. 103 | 104 | ;senw 105 | CheckType = Z - rail: 0x02000200 106 | CheckType = a - monorail: 0x03010000 rail: 0x02000200, 0xffffffff optional 107 | 108 | ConsLayout = ..X.. 109 | ConsLayout = ..#.< 110 | ConsLayout = ..#.. 111 | ConsLayout = ..^.. 112 | 113 | AutoTileBase = 0x55387000 114 | PlaceQueryID = 0x5f0f7a0f 115 | Costs = 600 116 | 117 | [HighwayIntersectionInfo_0x0001F212] 118 | CopyFrom = 0xF212 119 | Rotate = 1 120 | [HighwayIntersectionInfo_0x0002F212] 121 | CopyFrom = 0xF212 122 | Rotate = 2 123 | [HighwayIntersectionInfo_0x0003F212] 124 | CopyFrom = 0xF212 125 | Rotate = 3 126 | [HighwayIntersectionInfo_0x0004F212] 127 | CopyFrom = 0xF212 128 | [HighwayIntersectionInfo_0x0005F212] 129 | CopyFrom = 0x1F212 130 | [HighwayIntersectionInfo_0x0006F212] 131 | CopyFrom = 0x2F212 132 | [HighwayIntersectionInfo_0x0007F212] 133 | CopyFrom = 0x3F212 -------------------------------------------------------------------------------- /Controller/RUL2/08_NWM/REW_Splitter_Wyes.txt: -------------------------------------------------------------------------------- 1 | ;------Road to OWR-1 Symmetrical Wye------ 2 | ;--> Base Override of transition pieces 3 | 0x51602200,3,0,0x5F045B00,1,0=0x51602200,3,0,0x51602300,3,0 4 | 0x51602200,1,1,0x5F045B00,1,0=0x51602200,1,1,0x51602300,1,1 5 | ; 6 | ;------Road to OWR-1 Ortho Wye------ 7 | ;--> Base Override of transition pieces 8 | 0x51624300,3,0,0x5F045B00,1,0=0x51624300,3,0,0x51624400,3,0 9 | 0x51624300,1,1,0x5F045B00,1,0=0x51624300,1,1,0x51624400,1,1 10 | 0x51624100,3,0,0x5F045B00,1,0=0x51624100,3,0,0x51624200,3,0 11 | 0x51624100,1,1,0x5F045B00,1,0=0x51624100,1,1,0x51624200,1,1 12 | ; 13 | ;------Road to OWR-1 Ortho/Diag Wye------ 14 | ;--> Base Override of transition pieces 15 | 0x51626100,3,0,0x5F045B00,1,0=0x51626100,3,0,0x51626200,3,0 16 | 0x51626100,1,1,0x5F045B00,1,0=0x51626100,1,1,0x51626200,1,1 17 | 0x51626100,2,0,0x5F045C00,3,1=0x51626100,2,0,0x51626300,2,0; missing_paths 18 | 0x51626100,0,1,0x5F045C00,1,0=0x51626100,0,1,0x51626300,0,1; missing_paths 19 | ;--> Diagonal Out (0x51626300 or BA) 20 | ;-> Default Diagonal 21 | 0x51626300,3,0,0x09000A00,1,0=0x51626300,3,0,0x51030200,1,0 22 | 0x51626300,3,0,0x09000A00,0,1=0x51626300,3,0,0x51030200,0,1 23 | 0x51626300,1,1,0x09000A00,2,0=0x51626300,1,1,0x51030200,2,0 24 | 0x51626300,1,1,0x09000A00,3,1=0x51626300,1,1,0x51030200,3,1 25 | ;-> Diagonal Blend 26 | ;-> R1 27 | ; 28 | ;------Road to OWR-1 Diag/Diag Wye------ 29 | ;--> Base Override of transition pieces 30 | 0x5173BE00,0,0,0x5F045C00,1,0=0x5173BE00,0,0,0x51626300,0,1; missing_paths 31 | 0x5173BE00,0,1,0x5F045C00,1,0=0x5173BE00,0,1,0x51626300,0,1; missing_paths 32 | 0x5173BE00,2,0,0x5F045C00,3,1=0x5173BE00,2,0,0x51626300,2,0; missing_paths 33 | 0x5173BE00,2,1,0x5F045C00,3,1=0x5173BE00,2,1,0x51626300,2,0; missing_paths 34 | ;--> Diagonal Out (0x51626300 or BE) 35 | ;-> Default Diagonal 36 | ; (RD COVERED AT 516263) 37 | ;-> Diagonal Blend 38 | ; (RD COVERED AT 516263) 39 | ;-> R1 40 | ; (RD COVERED AT 516263) 41 | ; 42 | ;------Road to OWR-1 Folded Wye------ 43 | ;--> Base Override of transition pieces 44 | 0x5173C200,0,0,0x09705500,3,0=0x5173C200,0,0,0x5173C300,0,0 45 | 0x5173C200,2,0,0x09705500,1,1=0x5173C200,2,0,0x5173C300,2,1 46 | ;--> Ortho Out (0x5173C300) 47 | ; (Orth) 48 | 0x5173C300,0,0,0x09004b00,1,0=0x5173C300,0,0,0x51030000,1,0 49 | 0x5173C300,0,0,0x09004b00,3,0=0x5173C300,0,0,0x51030000,1,0 50 | 0x5173C300,2,1,0x09004b00,1,0=0x5173C300,2,1,0x51030000,3,0 51 | 0x5173C300,2,1,0x09004b00,3,0=0x5173C300,2,1,0x51030000,3,0 52 | ; (Orth Stub) 53 | ; (Orth-Diag) 54 | ; (90-Bend) 55 | ; (Small 90) 56 | ; (R1) 57 | ; 58 | ;------Road to OWR-1 Wide Ortho/Diag Combo Wye------ 59 | ;--> Base Override of transition pieces 60 | 0x5173C600,0,0,0x5F045C00,1,0=0x5173C600,0,0,0x51626300,0,1; missing_paths 61 | 0x5173C600,2,1,0x5F045C00,3,1=0x5173C600,2,1,0x51626300,2,0; missing_paths 62 | ;--> Diagonal Out (0x51626300 or C7) 63 | ;-> Default Diagonal 64 | ; covered at 516263 65 | ;-> Diagonal Blend 66 | ; covered at 516263 67 | ;-> R1 68 | ; covered at 516263 69 | ; 70 | ;------Road to OWR-1 Half-Folded Wye------ 71 | ;--> Base Override of transition pieces 72 | 0x5173C900,3,0,0x09705500,3,0=0x5173C900,3,0,0x5173CA00,3,0 73 | 0x5173C900,1,1,0x09705500,1,1=0x5173C900,1,1,0x5173CA00,1,1 74 | 0x5173C100,3,0,0x5F045B00,0,0=0x5173C100,3,0,0x5173C300,3,0 75 | 0x5173C100,3,0,0x5F045B00,0,1=0x5173C100,3,0,0x5173C300,3,0 76 | 0x5173C100,1,1,0x5F045B00,2,0=0x5173C100,1,1,0x5173C300,1,1 77 | 0x5173C100,1,1,0x5F045B00,2,1=0x5173C100,1,1,0x5173C300,1,1 78 | ;--> Ortho Out Turn (0x5173C300) 79 | ; covered above at 0x5173C3 80 | ;--> Ortho Out Straight (0x5173CA00) 81 | ; (Orth) 82 | 0x5173CA00,1,1,0x09004b00,1,0=0x5173CA00,1,1,0x51030000,1,0 83 | 0x5173CA00,1,1,0x09004b00,3,0=0x5173CA00,1,1,0x51030000,1,0 84 | 0x5173CA00,3,0,0x09004b00,1,0=0x5173CA00,3,0,0x51030000,3,0 85 | 0x5173CA00,3,0,0x09004b00,3,0=0x5173CA00,3,0,0x51030000,3,0 86 | ; (Orth Stub) 87 | ; (Orth-Diag) 88 | ; (90-Bend) 89 | ; (Small 90) 90 | ; (R1) 91 | --------------------------------------------------------------------------------