Skip to content

Commit

Permalink
#228 Created More VRow operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich2 committed Mar 22, 2023
1 parent 90f240e commit 8bfc355
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions EGrid/src/eg320/Terr320E0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ object Terr320E0 extends Long320Terrs
TRow(152, sea * 3, taigaHills),
TRow(150, sea * 3, taigaHills),
TRow(148, sea * 3, taigaHills, taiga),
TRow(146, sea, hills, sea, Head4Land(4), forest),
VRow(145, VertInUR(520), VertInUp(522)),
TRow(146, sea, hills, sea, Head4Land(4), Head3Land(2, Plains, Forest)),
//VRow(145, VertInUR(520), VertInUp(522)),
TRow(144, sea, Head4Land(5), plain, sea, plain),
TRow(142, sea, Head4Land(2), Head1Land(5), Head3Land(1), plain * 2),
TRow(140, sea, Head4Land(2, Hilly), Head2Land(5), plain * 3),
Expand Down
26 changes: 8 additions & 18 deletions EGrid/src/eg320/Terr320E30.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ object Terr320E30 extends Long320Terrs
def gs(r: Int, cStart: Int, tileValues: Multiple[WTile]*): Unit = { res.setRowEnd(r, cStart, tileValues :_*); () }
def wr(r: Int, tileValues: Multiple[WTile]*): Unit = { res.setRow(r, tileValues :_*); () }

wr(148, taiga * 2, taiga * 3)
wr(146, plain, taiga * 4)
wr(144, plain * 5)

gs(142, 1526, plain * 6)
gs(140, 1528, plain * 6)
gs(138, 1526, mtain * 2, hills, plain * 3, desert)
Expand All @@ -29,9 +27,7 @@ object Terr320E30 extends Long320Terrs

override val sTerrs: HSideLayer[WSide] =
{ val res: HSideLayer[WSide] = grid.newSideLayer[WSide](WSideNone)

//res.setSomeInts(WSideMid(Lake), 149,1537)
res.setSomeInts(WSideMid(), 145,1527, 146,1528, 147,1529, 147,1531, 147,1533)//Baltic

res.setSomeInts(WSideMid(), 131, 1527, 133,1525, 134,1524, 135,1523, 136,1522, 136,1542, 137,1541, 137,1543)
res.setSomeInts(WSideMid(), 130,1524, 131,1525, 132,1526, 132,1530)
res.setSomeInts(WSideMid(), 133,1531, 133,1533, 133,1535)//Bosphorus
Expand All @@ -45,18 +41,6 @@ object Terr320E30 extends Long320Terrs
override val corners: HCornerLayer =
{ val res = grid.newHVertOffsetLayer

// res.setMouth5(148, 1540)//Leke Ladoga south east

res.setCorner(144, 1528, 5, HVDn)//Baltic west
res.setCorner(144, 1528, 0, HVDR)//Baltic west
res.setCorner(146, 1530, 4, HVDR)//Baltic
res.setCorner(146, 1530, 5, HVDR)//Baltic
//res.setCorner(148, 1528, 3, HVUL)//Baltic
res.setTJunction(147, 1530)//Baltic - Gulf of Finland - Gulf of Bothnia
//res.setVert3In(148, 1532)//Helsinki - Tallinn
//res.setMouth4(148, 1536)//St Petersburg
//res.setVert5In(148, 1532)//Gulf of Bothnia

res.setMouth0(134, 1542)//Kerch straits

res.setTJunction(137, 1542)//Azov Sea
Expand Down Expand Up @@ -93,6 +77,12 @@ object Terr320E30 extends Long320Terrs
TRow(152, Head1Land(2, Plains, Taiga), taiga, sea, taiga),
VRow(151, VertInDR(1532)),
TRow(150, Head1Land(2, Plains, Taiga), taiga * 3),
VRow(149, MouthUL(1536, Lake), MouthDR(1538, Lake)),
VRow(147, MouthUR(1534)),
TRow(148, Head1Land(2, Plains, Taiga), Head3Land(3, Plains, Taiga), taiga * 3),
TRow(146, Head2Land(5), taiga * 4),
TRow(144, plain * 5),

)
}

Expand Down
25 changes: 24 additions & 1 deletion EGrid/src/egrid/WTerrSetter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ abstract class WTerrSetter(gridIn: HGrid, val terrs: HCenLayer[WTile], val sTerr

sealed trait VRowElem

/** Creates the head of a strait / river with the head up and the river going down. */
/** Creates the head of a strait / river / etc with the head up and the straits going down. */
case class MouthUp(c: Int, st: WSTerr = Sea) extends VRowElem

/** Creates the head of a strait / river with the head up right and the straits going down left. */
case class MouthUR(c: Int, st: WSTerr = Sea) extends VRowElem

/** Creates the head of a strait / river with the head down right and the straits going up left. */
case class MouthDR(c: Int, st: WSTerr = Sea) extends VRowElem

/** Creates the head of a strait / river with the head up left and the straits going down right. */
case class MouthUL(c: Int, st: WSTerr = Sea) extends VRowElem

case class VertInUR(c: Int, st1: WSTerr = Sea, st2: WSTerr = Sea) extends VRowElem
case class VertInDR(c: Int, st1: WSTerr = Sea, st2: WSTerr = Sea) extends VRowElem
Expand Down Expand Up @@ -60,6 +68,21 @@ abstract class WTerrSetter(gridIn: HGrid, val terrs: HCenLayer[WTile], val sTerr
sTerrs.set(row - 1, c, WSideMid(st))
}

case MouthUR(c, st) => {
corners.setMouth4(row + 1, c + 2)
sTerrs.set(row, c - 1, WSideMid(st))
}

case MouthDR(c, st) =>
{ corners.setMouth5(row - 1, c + 2)
sTerrs.set(row, c - 1, WSideMid(st))
}

case MouthUL(c, st) => {
corners.setMouth2(row + 1, c - 2)
sTerrs.set(row, c + 2, WSideMid(st))
}

case VertInUR(c, st1, st2) =>
{ corners.setVert4In(row + 1, c + 2)
sTerrs.setIf(row + 1, c, WSideMid(st1))
Expand Down

0 comments on commit 8bfc355

Please sign in to comment.