Skip to content

Commit 3d9de09

Browse files
committed
add metarules for new viaduct OSTs
1 parent 4e1b106 commit 3d9de09

2 files changed

Lines changed: 70 additions & 2 deletions

File tree

Controller/RUL2/07_RHW/Sec7h_Flex_Transition/Sec7h0_OnslopeMetaGenerated_MANAGED.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,45 @@
535535
0x57000000,3,0,0x57799100,1,0=0x57090000,1,0,0x57799100,1,0
536536
0x57000000,3,0,0x57799100,3,1=0x57090000,3,0,0x57799100,3,1
537537
0x57000000,1,0,0x57799100,3,1=0x57090000,3,0,0x57799100,3,1
538+
0x5C060000,1,0,0x00004B00,1,0=0x5C060000,1,0,0x5C000000,1,0
539+
0x5C060000,1,0,0x00004B00,3,0=0x5C060000,1,0,0x5C000000,3,0
540+
0x5C060100,1,0,0x00004B00,1,0=0x5C060100,1,0,0x5C030000,1,0
541+
0x5C060100,1,0,0x00004B00,3,0=0x5C060100,1,0,0x5C030000,3,0
542+
0x5C060010,1,0,0x00004B00,1,0=0x5C060010,1,0,0x5C030000,1,0
543+
0x5C060010,1,0,0x00004B00,3,0=0x5C060010,1,0,0x5C030000,3,0
544+
0x5C060000,1,0,0x5C030000,1,0=0x5C060010,1,0,0x5C030000,1,0
545+
0x5C060000,1,0,0x5C030000,3,0=0x5C060010,1,0,0x5C030000,3,0
546+
0x5C000000,1,0,0x5C060000,1,0=0x5C000000,1,0,0x5C060010,1,0
547+
0x5C000000,3,0,0x5C060000,1,0=0x5C000000,3,0,0x5C060010,1,0
548+
0x00004B00,1,0,0x5C060010,1,0=0x5C000000,1,0,0x5C060010,1,0
549+
0x00004B00,3,0,0x5C060010,1,0=0x5C000000,3,0,0x5C060010,1,0
550+
0x5C060010,1,0,0x5C000000,1,0=0x5C060010,1,0,0x5C030000,1,0
551+
0x5C060010,1,0,0x5C000000,3,0=0x5C060010,1,0,0x5C030000,3,0
552+
0x5C070000,1,0,0x09004B00,1,0=0x5C070000,1,0,0x5C010000,1,0
553+
0x5C070000,1,0,0x09004B00,3,0=0x5C070000,1,0,0x5C010000,3,0
554+
0x5C070100,1,0,0x09004B00,1,0=0x5C070100,1,0,0x5C040000,1,0
555+
0x5C070100,1,0,0x09004B00,3,0=0x5C070100,1,0,0x5C040000,3,0
556+
0x5C070010,1,0,0x09004B00,1,0=0x5C070010,1,0,0x5C040000,1,0
557+
0x5C070010,1,0,0x09004B00,3,0=0x5C070010,1,0,0x5C040000,3,0
558+
0x5C070000,1,0,0x5C040000,1,0=0x5C070010,1,0,0x5C040000,1,0
559+
0x5C070000,1,0,0x5C040000,3,0=0x5C070010,1,0,0x5C040000,3,0
560+
0x5C010000,1,0,0x5C070000,1,0=0x5C010000,1,0,0x5C070010,1,0
561+
0x5C010000,3,0,0x5C070000,1,0=0x5C010000,3,0,0x5C070010,1,0
562+
0x09004B00,1,0,0x5C070010,1,0=0x5C010000,1,0,0x5C070010,1,0
563+
0x09004B00,3,0,0x5C070010,1,0=0x5C010000,3,0,0x5C070010,1,0
564+
0x5C070010,1,0,0x5C010000,1,0=0x5C070010,1,0,0x5C040000,1,0
565+
0x5C070010,1,0,0x5C010000,3,0=0x5C070010,1,0,0x5C040000,3,0
566+
0x5C080000,1,0,0x04006100,1,0=0x5C080000,1,0,0x5C020000,1,0
567+
0x5C080000,3,1,0x04006100,3,0=0x5C080000,3,1,0x5C020000,3,0
568+
0x5C080100,1,0,0x04006100,1,0=0x5C080100,1,0,0x5C050000,1,0
569+
0x5C080100,3,1,0x04006100,3,0=0x5C080100,3,1,0x5C050000,3,0
570+
0x5C080010,1,0,0x04006100,1,0=0x5C080010,1,0,0x5C050000,1,0
571+
0x5C080010,3,1,0x04006100,3,0=0x5C080010,3,1,0x5C050000,3,0
572+
0x5C080000,1,0,0x5C050000,1,0=0x5C080010,1,0,0x5C050000,1,0
573+
0x5C080000,3,1,0x5C050000,3,0=0x5C080010,3,1,0x5C050000,3,0
574+
0x5C020000,1,0,0x5C080000,1,0=0x5C020000,1,0,0x5C080010,1,0
575+
0x5C020000,3,0,0x5C080000,3,1=0x5C020000,3,0,0x5C080010,3,1
576+
0x04006100,1,0,0x5C080010,1,0=0x5C020000,1,0,0x5C080010,1,0
577+
0x04006100,3,0,0x5C080010,3,1=0x5C020000,3,0,0x5C080010,3,1
578+
0x5C080010,1,0,0x5C020000,1,0=0x5C080010,1,0,0x5C050000,1,0
579+
0x5C080010,3,1,0x5C020000,3,0=0x5C080010,3,1,0x5C050000,3,0

src/main/scala/module/onslope.scala

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import RhwRuleGenerator.HeightLevel
1111
trait Onslope { this: RuleGenerator & Curve45Generator =>
1212

1313
def createOnslopeTransition(): Unit = {
14+
// RHW OSTs
1415
val rhw2SlopeL1 = L1Rhw2~EC & Dirtroad~CW // IdTile(0x57700000,1,0, (Dirtroad~EC).symmetries) // direction East (upper) to West (lower)
1516
val rhw2SlopeL2 = L2Rhw2~EC & Dirtroad~CW // IdTile(0x57700100,1,0, (Dirtroad~EC).symmetries) // direction East (upper) to West (lower)
16-
1717
for (main <- RhwNetworks - Rhw10c if main.height == 0) {
1818
val maxHeight = if ((Mis + Rhw4 + Rhw6s).contains(main)) 4 else 2
1919
val minHeight = if (main == Dirtroad) 1 else 0 // avoiding auto-L1Rhw2 and auto-L2Rhw2
@@ -32,6 +32,32 @@ trait Onslope { this: RuleGenerator & Curve45Generator =>
3232
}
3333
}
3434

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+
3561
createRules()
3662
}
3763
}
@@ -44,7 +70,7 @@ class OnslopeGenerator(var context: RuleTransducer.Context) extends RuleGenerato
4470

4571
// Compile individually with `sbt "runMain com.sc4nam.module.CompileOnslopeCode"`.
4672
object CompileOnslopeCode extends AbstractMain {
47-
lazy val resolve: IdResolver = new MiscResolver orElse new flexfly.FlexFlyResolver orElse new RhwResolver orElse new NwmResolver
73+
lazy val resolve: IdResolver = new MiscResolver orElse new flexfly.FlexFlyResolver orElse new RhwResolver orElse new NwmResolver orElse new ViaductResolver
4874
val generator = new OnslopeGenerator(_)
4975
lazy val file = new java.io.File("target/Sec7h0_OnslopeMetaGenerated_MANAGED.txt")
5076
}

0 commit comments

Comments
 (0)