First steps into serious world building code
This depends on one new library, `wherefore-art-thou` and some new work in `mw-engine`.
This commit is contained in:
parent
395c899a62
commit
833d69132f
7 changed files with 58 additions and 7 deletions
40
src/cc/journeyman/the_great_game/proving/core.clj
Normal file
40
src/cc/journeyman/the_great_game/proving/core.clj
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
(ns cc.journeyman.the-great-game.proving.core
|
||||
"Phase one of '[Baking the World](Bakine-the-world.html#phase-one-proving-the-procedural-world)'"
|
||||
(require [mw-engine.core :refer []]
|
||||
[mw-engine.drainage :refer []]
|
||||
[mw-engine.flow :refer []]))
|
||||
|
||||
(defn get-drainage-map
|
||||
"Given this `height-map` (a monochrome raster) and optionally this
|
||||
`rainfall-map` (also a monochrome raster), return a drainage map (exact
|
||||
format uncertain, probably still a raster)."
|
||||
([height-map])
|
||||
([height-map rainfall-map]))
|
||||
|
||||
(defn get-biome-map
|
||||
"Given this `height-map` (a monochrome raster) and optionally this
|
||||
`rainfall-map` (also a monochrome raster), return a biome map."
|
||||
([height-map])
|
||||
([height-map rainfall-map]))
|
||||
|
||||
(defn populate-world
|
||||
"Given this `biome-map` (as returned by `get-biome-map`), populate a world
|
||||
(probably some form of database) and return a structure which allows that
|
||||
database o be interrogated."
|
||||
[biome-map drainage-map])
|
||||
|
||||
(defn get-road-map
|
||||
[populated-world])
|
||||
|
||||
(defn prove
|
||||
"Given this `height-map` (a monochrome raster) and optionally this
|
||||
`rainfall-map` (also a monochrome raster), return a populated world."
|
||||
([height-map rainfall-map]
|
||||
(let [drainage-map (get-drainage-map height-map)
|
||||
biome-map (get-biome-map height-map rainfall-map)
|
||||
populated-world (populate-world biome-map drainage-map)]
|
||||
{:height-map height-map
|
||||
:drainage-map drainage-map
|
||||
:populated-world populated-world
|
||||
:road-map (get-road-map populated-world)})))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue