<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="../../../../coverage.css"/> <title> cc/journeyman/the_great_game/buildings/module.clj </title> </head> <body> <span class="covered" title="1 out of 1 forms covered"> 001 (ns cc.journeyman.the-great-game.buildings.module </span><br/> <span class="blank" title="0 out of 0 forms covered"> 002 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 003 "A module of a building; essentially something like a portacabin, which can be </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 004 assembled together with other modules to make a complete building. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 005 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 006 Modules need to include </span><br/> <span class="blank" title="0 out of 0 forms covered"> 007 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 008 1. Ground floor modules, having external doors; </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 009 2. Craft modules -- workshops -- which will normally be ground floor (except </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 010 weavers) and may have the constraint that no upper floor module can cover them; </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 011 3. Upper floor modules, having NO external doors (but linking internal doors); </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 012 4. Roof modules </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 013 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 014 **Role** must be one of: </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 015 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 016 1. `:primary` a ground floor main entrance module </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 017 2. `:secondary` a module which can be upper or ground floor </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 018 3. `:upper` a module which can only be on an upper floor, for example one </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 019 with a projecting gallery, balcony or overhang. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 020 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 021 Other values for `role` will emerge. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 022 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 023 **Exits** must be a sequence of keywords taken from the following list: </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 024 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 025 1. `:left` an exit in the centre of the left wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 026 2. `:left-front` an exit in the centre of the left half of the front wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 027 3. `:front` an exit in the centre of the front wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 028 4. `:right-front` an exit in the centre of the right half of the front wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 029 5. `:right` an exit in the centre of the right wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 030 6. `:right-back` an exit in the centre of the right half of the back wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 031 7. `:left-back` an exit in the centre of the back wall </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 032 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 033 A module placed on an upper floor must have no exit which opens beyond the </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 034 footprint of the floor below - no doors into mid air! However, it is allowable </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 035 (and indeed is necessary) to allow doors into roof spaces if the adjacent </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 036 module on the same floor does not yet exist, since otherwise it would be </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 037 impossible to access a new room which might later be built there. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 038 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 039 **Load** must be a small integer indicating both the weight of the module and </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 040 the total amount of weight it can support. So for example a stone-built module </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 041 might have a `load` value of 4, a brick built one of 3, and a half-timbered one </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 042 of 2, and a tent of 0. This means a stone ground floor module could support one </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 043 further floor of stone or brick, or two further floors of half timbered </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 044 construction; while a brick built ground floor could support a single brick or </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 045 half-timbered upper floor but not a stone one, and a half-timbered ground floor </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 046 could only support a half timbered upper floor. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 047 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 048 There also needs to be an undercroft or platform module, such that the area of </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 049 the top of the platform is identical with the footprint of the building, and </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 050 the altitude of the top of the platform is equal to the altitude of the </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 051 terrain at the heighest corner of the building; so that the actual </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 052 building doesn't float in the air, and also so that none of the doors or windows </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 053 are partly underground. </span><br/> <span class="blank" title="0 out of 0 forms covered"> 054 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 055 Each module needs to wrap an actual 3d model created in Blender or whatever, </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 056 and have a list of optional **textures** with which that model can be rendered. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 057 So an upper floor bedroom module might have the following renders: </span><br/> <span class="blank" title="0 out of 0 forms covered"> 058 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 059 1. Bare masonry - constrained to upland or plateau terrain, and to coastal culture </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 060 2. Painted masonry - constrained to upland or plateau terrain, and to coastal culture </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 061 3. Half-timbered - not available on plateau terrain </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 062 4. Weatherboarded - constrained to forest terrain </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 063 5. Brick - constrained to arable or arid terrain </span><br/> <span class="blank" title="0 out of 0 forms covered"> 064 </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 065 of course these are only examples, and also, it's entirely possible to have </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 066 for example multiple different weatherboard renders for the same module. </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 067 There needs to be a way of rendering what can be built above what: for </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 068 example, you can't have a masonry clad module over a half timbered one, </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 069 but you can have a half-timbered one over a masonry one.") </span><br/> <span class="blank" title="0 out of 0 forms covered"> 070 </span><br/> <span class="covered" title="1 out of 1 forms covered"> 071 (defrecord BuildingModule </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 072 [model </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 073 ^Double length </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 074 ^Double width </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 075 ^Double height </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 076 ^Integer load </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 077 ^clojure.lang.Keyword role </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 078 ^clojure.lang.IPersistentCollection textures </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 079 ^clojure.lang.IPersistentCollection exits </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 080 ] </span><br/> <span class="not-tracked" title="0 out of 0 forms covered"> 081 ) </span><br/> </body> </html>