Skip to content

Commit

Permalink
#228 Started to convert 320km E60 to helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich2 committed Mar 27, 2023
1 parent a132c0c commit 069d31f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 32 deletions.
4 changes: 2 additions & 2 deletions EGrid/src/eg320/Multi320Systems.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prid._, phex._, egrid._, pEarth._
/** Scenario for 2 Grid system for 0E and 30E */
object Scen320s0e1 extends EScenLongMulti
{ override val title: String = "320km 0E - 30E"
override implicit val gridSys: EGrid320LongMulti = EGrid320.multi(2, 0, 124)// Grids320S0E1
override implicit val gridSys: EGrid320LongMulti = EGrid320.multi(2, 0, 124, 162)
override val terrs: HCenLayer[WTile] = fullTerrsHCenLayerSpawn
override val sTerrs: HSideLayer[WSide] = fullTerrsSideLayerSpawn
override val corners: HCornerLayer = fullTerrsCornerLayerSpawn
Expand All @@ -32,7 +32,7 @@ object Scen320ChinaJapan extends EScenLongMulti
object Grids320S11E2 extends EGrid320LongMulti
{ ThisSys =>
override def gridsXSpacing: Double = 40
override val grids: RArr[EGridLongFull] = EGrid320.grids(4, 11, 126)
override val grids: RArr[EGridLongFull] = EGrid320.grids(4, 11, 126, 164)
override val gridMans: RArr[EGridLongMan] = iToMap(3)(EGridLongMan(_, ThisSys))
override val headGridInt: Int = 11
}
Expand Down
2 changes: 1 addition & 1 deletion EGrid/src/eg320/Terr320E0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import prid._, phex._, egrid._, WTile._
* area it must be assigned to France */
object Terr320E0 extends Long320Terrs
{
override implicit val grid: EGrid320LongFull = EGrid320.e0(124)
override implicit val grid: EGrid320LongFull = EGrid320.e0(124, 168)
override val terrs: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
override val sTerrs: HSideLayer[WSide] = grid.newSideLayer[WSide](WSideNone)
override val corners: HCornerLayer = grid.newHVertOffsetLayer
Expand Down
4 changes: 3 additions & 1 deletion EGrid/src/eg320/Terr320E30.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package ostrat; package eg320
import prid.phex._, egrid._, WTile._

object Terr320E30 extends Long320Terrs
{ override implicit val grid: EGrid320LongFull = EGrid320.e30(124)
{ override implicit val grid: EGrid320LongFull = EGrid320.e30(124, 166)
override val terrs: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
override val sTerrs: HSideLayer[WSide] = grid.newSideLayer[WSide](WSideNone)
override val corners: HCornerLayer = grid.newHVertOffsetLayer

val help = new WTerrSetter(grid, terrs, sTerrs, corners)
{
override val rowDatas: RArr[RowBase] = RArr(
TRow(164, Island(Plains, IceCap)),
TRow(162, Island(Mountains, IceCap)),
TRow(156, Headland(2, 5, Hilly, Tundra), Headland(2, 0, Hilly, Tundra), sea),
VRow(155, MouthDn(1538)),
TRow(154, taigaHills, taiga * 2, Headland(4, 0, Plains, Tundra)),
Expand Down
30 changes: 19 additions & 11 deletions EGrid/src/eg320/Terr320E60.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,12 @@ import prid._, phex._, egrid._, WTile._

object Terr320E60 extends Long320Terrs
{
override implicit val grid: EGrid320LongFull = EGrid320.e60(120)
override implicit val grid: EGrid320LongFull = EGrid320.e60(120, 164)

override val terrs: HCenLayer[WTile] =
{ val res: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
def wr(r: Int, tileValues: Multiple[WTile]*): Unit = { res.setRow(r, tileValues :_*); () }
wr(160, tundra, sea)
wr(158, tundra, sea, tundra)
wr(156, sea * 2, tundra)
wr(154, tundra * 4)
wr(152, taiga * 4)
wr(150, taiga * 4)
wr(148, forest, taiga * 4)
wr(146, forest * 2, taiga * 3)
wr(144, forest * 5)
wr(142, plain * 6)

wr(140, plain * 2, desert * 3, plain)
wr(138, plain, desert * 6)
wr(136, sea, desert * 6)
Expand Down Expand Up @@ -51,4 +42,21 @@ object Terr320E60 extends Long320Terrs
res.setMouth4(138, 2554)//Caspian Sea north east
res
}

val help = new WTerrSetter(grid, terrs, sTerrs, corners)
{ override val rowDatas: RArr[RowBase] = RArr(
TRow(160, Headland(1, 5, Plains, Tundra), sea),
TRow(158, Headland(4, 2, Plains, Tundra), sea, tundra),
TRow(156, sea * 2, tundra),
TRow(154, tundra * 4),
TRow(152, taiga * 4),
TRow(150, taiga * 4),
TRow(148, forest, taiga * 4),
TRow(146, forest * 2, taiga * 3),
TRow(144, forest * 5),
TRow(142, plain * 6),
)
}

help.run
}
32 changes: 16 additions & 16 deletions EGrid/src/eg320/Terr320W30.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import prid._, phex._, egrid._, WTile._

/** 320km hex terrain centred on 30 west. */
object Terr320W30 extends Long320Terrs
{
override implicit val grid: EGrid320LongFull = EGrid320.w30(124)
{ override implicit val grid: EGrid320LongFull = EGrid320.w30(124, 164)
override val terrs: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
override val sTerrs: HSideLayer[WSide] = grid.newSideLayer[WSide](WSideNone)
override val corners: HCornerLayer = grid.newHVertOffsetLayer

override val terrs: HCenLayer[WTile] =
{ val res: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
def gs(r: Int, cStart: Int, tileValues: Multiple[WTile]*): Unit = { res.setRowEnd(r, cStart, tileValues :_*); () }
gs(160, 11776, ice, sea)
gs(158, 11774, ice * 2, sea)
gs(156, 11772, ice * 2, sea)
gs(154, 11770, ice, tundra, sea * 2)
gs(152, 11780, hills * 2)
res
}
override val sTerrs: HSideLayer[WSide] =
{ val res: HSideLayer[WSide] = grid.newSideLayer[WSide](WSideNone)
res
val help = new WTerrSetter(grid, terrs, sTerrs, corners)
{ override val rowDatas: RArr[RowBase] = RArr(
TRow(164, ice),
TRow(162, ice * 2),
TRow(160, ice, Headland(2, 1, Plains, IceCap)),
TRow(158, ice * 2, sea),
TRow(156, ice * 2, sea),
TRow(154, ice, tundra, sea * 2),
TRow(152, Headland(1, 2, Hilly, IceCap), sea, tundraHills * 2),
TRow(150, Headland(2, 2, Hilly, IceCap))
)
}

override val corners: HCornerLayer = grid.newHVertOffsetLayer
help.run
}
2 changes: 1 addition & 1 deletion EGrid/src/eg320/Terr320W60.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prid._, phex._, egrid._, WTile._
/** 320km terrain for 60 west. */
object Terr320W60 extends Long320Terrs
{
override implicit val grid: EGrid320LongFull = EGrid320.w60(128)
override implicit val grid: EGrid320LongFull = EGrid320.w60(128, 162)

override val terrs: HCenLayer[WTile] =
{ val res: HCenLayer[WTile] = grid.newHCenLayer[WTile](sea)
Expand Down
1 change: 1 addition & 0 deletions EGrid/src/egrid/WTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ trait LandLike extends WTile
case Taiga => Chocolate.average(Taiga.colour)
case Forest => Chocolate.average(Forest.colour)
case Desert => Chocolate.average(Desert.colour)
case IceCap => Chocolate.average(IceCap.colour).average(IceCap.colour)
case _ => Chocolate
}
case Mountains => Gray
Expand Down

0 comments on commit 069d31f

Please sign in to comment.