Skip to content

Commit

Permalink
Corrected 320km Sicily may not need #235.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich2 committed Apr 9, 2023
1 parent 9efc43f commit faad6fa
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
5 changes: 5 additions & 0 deletions EGrid/src/eg320/Multi320Systems.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ object Scen320s0e1 extends EScenLongMulti
override val terrs: HCenLayer[WTile] = fullTerrsHCenLayerSpawn
override val sTerrs: HSideOptLayer[WSide, WSideSome] = fullTerrsSideLayerSpawn
override val corners: HCornerLayer = fullTerrsCornerLayerSpawn
val hs = HSide(131, 1521)
val lh1 = hs.tileLtOpt
debvar(lh1)
val lhtv = hs.tileLtAndVertFromRt(130)
debvar(lhtv)
}

/** Scenario for 3 320km grid system for 0E, 30E and 60E */
Expand Down
5 changes: 3 additions & 2 deletions EGrid/src/eg320/Terr320E0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ object Terr320E0 extends Long320Terrs
VRow(135, VertIn(526, HVUR)),
TRow(134, sea, hills * 3, sea, Isle(Hilly()), Hland(1, 1, Hilly())),
TRow(132, sea, hills, plain * 2, sea, Isle(Hilly()), sea),
TRow(130, sea, Hland(3, 3), Hland(1, 3, Hilly()), Hland(2, 2, Hilly()), sea * 2, Hland(3, 5, Hilly()), Hland(3, 3, Hilly())),
TRow(130, sea, Hland(3, 3), Hland(1, 3, Hilly()), Hland(2, 2, Hilly()), sea * 2, Hland(3, 5, Hilly()), Hland(2, 3, Hilly())),
TRow(128, sea, Hland(2, 5, Hilly()), Hland(1, 0, Hilly()), hills * 3, Hland(1, 1, Hilly()), sea),
TRow(126, sea, Hland(1, 5), mtain, desertHills, desert * 4),
TRow(124, sea, desertHills, hills, desert * 6),
)
}
help.run

//corners.setCorner(130, 526, 0, HVUL)
corners.setCorner(130, 526, 0, HVUL)
corners.setCornerPair(132, 524, 2, HVExact, HVUL)
}

object BritReg
Expand Down
2 changes: 1 addition & 1 deletion EGrid/src/eg320/Terr320E30.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object Terr320E30 extends Long320Terrs
override val rowDatas: RArr[RowBase] = RArr(
TRow(166, sice),
TRow(164, Isle(Level(IceCap), WSeaIce)),
TRow(162, Hland(2, 1, Mountains(IceCap))),
TRow(162, Hland(2, 2, Mountains(IceCap))),
TRow(156, Hland(2, 5, Hilly(Tundra)), Hland(2, 0, Hilly(Tundra)), sea),
VRow(155, Mouth(1538, HVDn)),
TRow(154, taigaHills, taiga * 2, Hland(4, 0, Level(Tundra))),
Expand Down
1 change: 0 additions & 1 deletion EGrid/src/egrid/ExpWorldGui.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ExpWorldGui(val canv: CanvasPlatform, scenIn: EScenBasic, viewIn: HGView,
def frame: RArr[GraphicElem] =
{ def tilePolys: HCenPairArr[Polygon] = proj.hCenPolygons(corners)


def tileFrontFills: RArr[PolygonFill] = tilePolys.pairMap{ (hc, poly) => poly.fill(terrs(hc)(gridSys).colour) }

def tileActives: RArr[PolygonActive] = tilePolys.pairMap{ (hc, poly) => poly.active(hc) }
Expand Down
7 changes: 4 additions & 3 deletions Tiling/srcHex/HCornerLayer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ final class HCornerLayer(val unsafeArray: Array[Int])

case Some(_) => {
val (hcRt, vi) = hs.tileRtAndVert
val (hcLta, lvi) = hs.tileLtAndVertFromRt(hcRt.r)
val p1: HVAndOffset = cornerV1(hcRt, vi)
val p2: HVAndOffset = cornerV1(hcRt, (vi - 1) %% 6)
val p3: HVAndOffset = cornerV1(hcLt, (vi - 3) %% 6)
val p4: HVAndOffset = cornerV1(hcLt, (vi + 2) %% 6)
PolygonHVAndOffset(hcRt.vExact(vi), p1, p2, hcLt.vExact(vi - 3), p3, p4)
val p3: HVAndOffset = cornerV1(hcLta, (lvi + 1)/* (vi - 3 )*/ %% 6)
val p4: HVAndOffset = cornerV1(hcLta, (lvi) /* (vi + 2 )*/ %% 6)
PolygonHVAndOffset(hcRt.vExact(vi), p1, p2, hcRt.vExact(vi - 1), /*hcLt.vExact(vi - 3),*/ p3, p4)
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions Tiling/srcHex/HSide.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ trait HSide extends HCenOrSide with TSide
/** Not precisely sure what this method is doing. */
def tileLtAndVert: (HCen, Int)

def tileLtAndVertFromRt(rtCenR: Int)(implicit gSys: HGridSys): (HCen, Int)

/** Returns the [[HCen]] of the left tile and the index of the lower vertex as it follows the sides in a clockwise direction. */
def tileLtAndVertUnsafe(implicit gSys: HGridSys) = gSys.sideTileLtAndVertUnsafe(this)

Expand Down Expand Up @@ -99,6 +101,14 @@ class HSideA(val r: Int, val c: Int) extends HSide
override def tileLtReg: HCen = HCen(r - 1, c - 1)
override def tileRtReg: HCen = HCen(r + 1, c + 1)
override def tileLtAndVert: (HCen, Int) = (HCen(r - 1, c - 1), 0)


override def tileLtAndVertFromRt(rtCenR: Int)(implicit gSys: HGridSys): (HCen, Int) =
{ val hCen = tileLt
val i = ife(hCen.r == rtCenR - 2, 0, 2)
(hCen, i)
}

override def tileRtAndVert: (HCen, Int) = (HCen(r + 1, c + 1), 4)
override def lineSegHC: LineSegHC = LineSegHC(r, c - 1, r, c + 1)
override def unsafeTiles: (HCen, HCen) = (HCen(r - 1, c - 1), HCen(r + 1, c + 1))
Expand Down Expand Up @@ -131,6 +141,9 @@ class HSideB(val r: Int, val c: Int) extends HSide
override def tileLtReg: HCen = HCen(r, c - 2)
override def tileRtReg: HCen = HCen(r, c + 2)
override def tileLtAndVert: (HCen, Int) = (HCen(r, c - 2), 1)

override def tileLtAndVertFromRt(rtCenR: Int)(implicit gSys: HGridSys): (HCen, Int) = (tileLt/*HCen(r, c - 2)*/, 1)

override def tileRtAndVert: (HCen, Int) = (HCen(r, c + 2), 5)
override def lineSegHC: LineSegHC = LineSegHC(r + 1, c, r - 1, c)
override def unsafeTiles: (HCen, HCen) = (HCen(r, c - 2), HCen(r, c + 2))
Expand Down Expand Up @@ -163,6 +176,13 @@ class HSideC(val r: Int, val c: Int) extends HSide
override def tileLtReg: HCen = HCen(r + 1, c - 1)
override def tileRtReg: HCen = HCen(r - 1, c + 1)
override def tileLtAndVert: (HCen, Int) = (HCen(r + 1, c - 1), 2)

override def tileLtAndVertFromRt(rtCenR: Int)(implicit gSys: HGridSys): (HCen, Int) =
{ val hCen = tileLt
val i = ife(hCen.r == rtCenR + 2, 2, 0)
(hCen, i)
}

override def tileRtAndVert: (HCen, Int) = (HCen(r - 1, c + 1), 0)
override def lineSegHC: LineSegHC = LineSegHC(r, c + 1, r, c - 1)
override def unsafeTiles: (HCen, HCen) = (HCen(r + 1, c - 1), HCen(r - 1, c + 1))
Expand Down

0 comments on commit faad6fa

Please sign in to comment.