Skip to content

Commit

Permalink
#206, #224 Made Sicily into an island.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich2 committed Mar 14, 2023
1 parent 136d351 commit f57fef2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 30 deletions.
25 changes: 18 additions & 7 deletions Dev/srcGrand/dless/DLessGui.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright 2018-23 Richard Oliver. Licensed under Apache Licence version 2.0. */
package ostrat; package dless
import geom._, pEarth._, prid._, phex._, pgui._, egrid._
import geom._, prid._, phex._, pgui._, egrid._

case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isFlat: Boolean = false) extends HGridSysGui("Diceless Gui")
{ var scen = scenIn
Expand All @@ -23,22 +23,33 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF
def tileFills: RArr[PolygonFill] = proj.hCensMap { hc =>
corners.tilePoly(hc).map { hvo => hvo.toPt2(proj.transCoord(_)) }.fill(terrs(hc).colour) }

val islands: GraphicElems = terrs.hcOptMap { (tile, hc) =>
tile match {
case island: Island => {
val poly = hc.vertsIn(7).map(hv => hv.toPt2(proj.transCoord))
Some(poly.fill(island.landColour))
}
case _ => None
}
}
def tileActives: RArr[PolygonActive] = proj.hCensMap { hc =>
corners.tilePoly(hc).map { hvo => hvo.toPt2(proj.transCoord(_)) }.active(hc) }

def straits: GraphicElems = proj.sidesOptMap { (hs: HSide) =>
val sTerr: Option[WSide] = sTerrs(hs)
sTerr.map { st => corners.sideVerts(hs).project(proj).fill(st.colour) }
val sTerr2 = sTerr.flatMap {
case s: WSideLands => Some(s)
case _ => None
}
sTerr2.map { st => corners.sideVerts(hs).project(proj).fill(st.colour) }
}

def lines1: GraphicElems = proj.linksOptMap { hs =>
val hc1 = hs.tileLt
val hc2 = hs.tileRt
val t1 = terrs(hc1)
def t2: WTile = terrs(hs.tileRt)

def t2 = terrs(hs.tileRt)

if (sTerrs(hs).nonEmpty | t1 != t2) None
if (sTerrs(hs).nonEmpty | t1.colour != t2.colour) None
else
{ val cs: (HCen, Int, Int) = hs.corners
val ls1 = corners.sideLine(cs._1, cs._2, cs._3)
Expand Down Expand Up @@ -68,7 +79,7 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF
/** This is the graphical display of the planned move orders. */
def moveGraphics: GraphicElems = moveSegPairs.pairFlatMap { (seg, pl) => seg.draw(pl.colour).arrow }

tileFills ++ tileActives ++ straits ++ lines2 ++ hexStrs2 ++ units ++ moveGraphics
tileFills ++ islands ++ tileActives ++ straits ++ lines2 ++ hexStrs2 ++ units ++ moveGraphics
}

/** Creates the turn button and the action to commit on mouse click. */
Expand Down
18 changes: 5 additions & 13 deletions EGrid/src/eg320/Terr320E0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object Terr320E0 extends Long320Terrs

wr(156, sea * 3)
wr(154, sea * 4)
wr(152, sea * 3, taigaHills)
wr(152, sea * 3, taigaHills)
wr(150, sea * 3, taigaHills)
wr(148, sea * 3, taigaHills, taiga)
wr(146, sea, hills, sea, plain, forest)
Expand All @@ -27,7 +27,7 @@ object Terr320E0 extends Long320Terrs
wr(136, sea * 3, plain, hills, mtain, plain)
wr(134, sea, hills * 3, sea, SeaIsland(Hilly, OpenTerrain), hills)
wr(132, sea, hills, plain * 2, sea, SeaIsland(Hilly, OpenTerrain), sea)
wr(130, sea, plain, hills * 2, sea * 3, hills)
wr(130, sea, plain, hills * 2, sea * 2, hills, SeaIsland(Hilly, OpenTerrain))
wr(128, sea * 2, hills * 5, sea)
wr(126, sea * 2, mtain, desertHills, desert * 4)
wr(124, sea * 2, hills, desert * 6)
Expand All @@ -41,7 +41,9 @@ object Terr320E0 extends Long320Terrs
res.setSomeInts(SISea, 133,521)//Sardinia - Corsica
res.setSomeInts(SLSea, 135,523)//Corsica
res.setSomeInts(SRSea, 135,521, 134,524)//Corsica
res.setSomeInts(SCSea, 129,507, 129,509, 129,511, 129,525, 130,528, 131,527, 134,528, 135,527, 136,526)//Mediterranean
res.setSomeInts(SCSea, 129,507, 129,509, 129,511, 134,528, 135,527, 136,526)//Mediterranean
res.setSomeInts(SRSea, 129,525)//Sicily - Tunis
res.setSomeInts(SLSea, 130,528, 131,527)//Sicily - Italy
res
}

Expand Down Expand Up @@ -77,21 +79,11 @@ object Terr320E0 extends Long320Terrs
res.setCornerIn(134, 526, 1)//Adriatic
res.setCorner(134, 526, 2, HVDL)//Adriatic

res.setCornerPair(132, 524, 2, HVUR, HVUL)//Sicily Italy
res.setCorner(130, 526, 0, HVUL)//Sicily Italy
res.setCornerIn(130, 526, 1)//Sicily Italy
res.setCornerIn(130, 526, 2)//Sicily Italy
res.setCornerPair(128, 528, 0, HVUL, HVUR)//Sicily Italy south mouth


res.setMouth1(128, 504)//Gibraltar
res.setVert0In(128, 508)//South Spain
res.setVert3In(130, 510)//South Spain
res.setMouth4(130, 514)//East end of Gibraltar Straits

res.setMouth2(130, 522) //Tunis Sicily west
res.setMouth5(128, 528) //Tunis Sicily east

res
}
}
Expand Down
9 changes: 2 additions & 7 deletions EGrid/src/eg320/Terr320E30.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ object Terr320E30 extends Long320Terrs
res.setSomeInts(SCLake, 149, 1537)
res.setSomeInts(SCSea, 145,1527, 146,1528, 147,1529, 147,1531, 147,1533, 148,1530, 149,1531, 150,1532, 151,1533, 152,1534)//Baltic
res.setSomeInts(SCSea, 133,1525, 133,1535, 134,1524, 135,1523, 136,1522, 136,1542, 137,1541, 137,1543)
res.setSomeInts(SCSea, 130,1520, 130,1524, 131,1525, 131,1533, 132,1534, 132,1526, 132,1530)
res.setSomeInts(SCSea, 131,1521)
res.setSomeInts(SCSea, 130,1524, 131,1525, 131,1533, 132,1534, 132,1526, 132,1530)
res.setSomeInts(SLSea, 130,1520, 131,1521)//Sicily - Italy
res
}

Expand Down Expand Up @@ -98,11 +98,6 @@ object Terr320E30 extends Long320Terrs
res.setVert5In(132, 1536)//Sea of Marmara
res.setMouth4(134, 1538)//Constantinople

res.setCorner(132, 1524, 4, HVUR)//Sicily - Italy north, has to be upright rather than down right because the end rows are 132,524 and 130,526
res.setCorner(130, 1522, 0, HVUR)//Sicily - Italy north, has to be upright rather than down right because the end rows are 132,524 and 130,526
res.setCornerIn(130, 1522, 5)//Sicily Italy
res.setCornerIn(130, 1522, 4)//Sicily Italy south

res
}
}
3 changes: 0 additions & 3 deletions EGrid/src/egrid/WSide.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package ostrat; package egrid
import Colour._

trait WSide extends Coloured// with ShowSimple
{

}

/** A Side between 2 lands. */
trait WSideLands extends WSide
Expand Down

0 comments on commit f57fef2

Please sign in to comment.