Skip to content

Commit

Permalink
Add sketch for new game builder api
Browse files Browse the repository at this point in the history
  • Loading branch information
grancalavera committed Mar 12, 2019
1 parent e4702a2 commit cc4995e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lib/Labyrinth/Game.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,43 @@ defaultGame :: Players -> IO (Maybe Game)
defaultGame players =
newGame tiles gates players 9 9 T.treasures extraTilePosition positions

{-
- Take a blank board of dimensions 9x9
- Index it starting at 0
0 1 2 3 4 5 6 7 8
0 G G G
1 A C B C B C A
2 G C C C C C C C G
3 B C B C B C B
4 G C C C C C C C G
5 B C B C B C B
6 G C C C C C C C G
7 A C B C B C A
9 G G G
G: Build a gate
A: Build a corner with a direction and a player key
B: Build a fixed tile: a fork with a direction and a treasure marker
C: Build a random tile:
- Pick a terrain from the remaining terrains
- Somehow choose if you need to add a treasure, keep
in mind we don't all the treasures to be placed
in adjacent tiles, we'd like to distribute them
-}

data BuildTile = BuildGate Direction
| BuildCorner Direction PlayOrder
| BuildFixed Direction
| BuildRandom

data Materials = Materials {
corners :: Int,
paths :: Int,
forks :: Int,
treasures :: Int
}

gates :: Board GateCell
gates = Board.fromList $ map
(\(p, d) -> (p, Cell.mkCell Gate d (GateCell True)))
Expand Down

0 comments on commit cc4995e

Please sign in to comment.