; demo-taxi town layout library (phase 5.9)
;
; Entries extend/replace the built-in layouts (village-house,
; town-rowhouse, city-block, city-tower).  Syntax:
;   (layout name [:tags (tag ...)] [:score n] body...)
; :tags  — matched against the town area's Preferred Types (empty area
;          list = the district default tag set); only layouts sharing a
;          tag are candidates for a lot.
; :score — weight of the random pick between candidates (default 1).
; Rooms carry :type so the interior generator knows where beds and
; living-room furniture go (phase 4.7.3).  Front-right parking rects
; keep the bays beside the shell and clear of the front-door corridor
; (phase 6.6).

; The 3-room C-shape house authored on edge 0 of road page 2_2
; (corridor spine with the living room and bedroom branching off the
; far side; the open middle rect is the courtyard notch).
(layout c-shape-house :tags (house village town) :score 3
(let ((w 20) (d 25))
(shell w d :floors 1 :empty)
(floor 0
   (room corridor1 (rect 0 0 0.2 1))
   (room livingroom1 (rect 0.2 0 1 0.35) :type living)
   (room bedroom1 (rect 0.2 0.65 1 1) :type bedroom)
   (connect corridor1 livingroom1)
   (connect corridor1 bedroom1)
   (door front -8)
   (windows all))
(roof normal 0 0 w d)
(parking (rect-front-center 7.8 5.2))))

; Small one-floor cottage: living room + bedroom side by side.
(layout cottage :tags (house village) :score 2
(let ((w 12) (d 10))
(shell w d :floors 1 :empty)
(floor 0
   (room living1 (rect 0 0 0.55 1) :type living)
   (room bedroom1 (rect 0.55 0 1 1) :type bedroom)
   (connect living1 bedroom1)
   (door front center)
   (windows all))
(roof gable 0 0 w d)
(parking (rect-front-center 5.2 5.2))))

; Two-floor family house: living+kitchen downstairs, bedrooms up.
(layout two-floor-house :tags (house village town) :score 1
(let ((w 14) (d 12))
(shell w d :floors 2 :empty)
(floor 0
   (room living1 (rect 0 0 0.5 1) :type living)
   (room kitchen1 (rect 0.5 0 1 1) :type kitchen)
   (connect living1 kitchen1)
   (door front center)
   (windows all))
(floor 1
   (room bedroom1 (rect 0 0 0.5 1) :type bedroom)
   (room bedroom2 (rect 0.5 0 1 1) :type bedroom)
   (connect bedroom1 bedroom2)
   (windows all))
(roof gable 0 0 w d)
(parking (rect-front-center 5.2 5.2))))

; Single-floor corner shop with a flat roof.  Commercial lots get
; at least 4 bays along the road (13 m = 5 bays here, 6.6.6).
(layout corner-shop :tags (commercial shop village town) :score 1
(let ((w 16) (d 12))
(shell w d :floors 1 :empty)
(floor 0
   (room shop1 (rect 0 0 0.7 1) :type shop)
   (room storage1 (rect 0.7 0 1 1) :windows none)
   (connect shop1 storage1)
   (door front center)
   (windows front))
(roof flat 0 0 w d)
(parking (rect-front-center 13 5.2))))

; ---------------------------------------------------------------------
; Reference layouts (phase 6.8.13): one per location kind, exercising
; tags -> POI database -> entry POI -> schedule assignment -> stat
; effects.  Home is idle rest (no activation and no behavior trees
; required); job pays money + raises stress with opening hours and an
; employee back door; leisure relieves stress for a money cost with a
; customer front door.
; ---------------------------------------------------------------------

; Home: a residence.  Idle rest with a weaker stress-recovery effect
; (no POI activation at home).
(layout ref-home :tags (house village town) :score 1
(let ((w 12) (d 10))
(shell w d :floors 1 :empty)
(floor 0
   (room living1 (rect 0 0 0.55 1) :type living
         :effects ((stress -1)))
   (room bedroom1 (rect 0.55 0 1 1) :type bedroom)
   (connect living1 bedroom1)
   (door front center)
   (windows all))
(roof gable 0 0 w d)
(parking (rect-front-center 5.2 5.2))))

; Job: a shop/office with a work counter.  money:+5/h, stress:+1/h,
; open 9-18, employee back door (6.8.8).
(layout ref-shop :tags (commercial shop village town) :score 1
(let ((w 16) (d 12))
(shell w d :floors 1 :empty)
(floor 0
   (room shop1 (rect 0 0 0.7 1) :type shop
         :effects ((money 5) (stress 1)))
   (room storage1 (rect 0.7 0 1 1) :windows none)
   (connect shop1 storage1)
   (door front center)
   (door back center)
   (windows front))
(roof flat 0 0 w d)
(parking (rect-front-center 13 5.2))))

; Leisure: a park/cafe.  money:-2/h, stress:-4/h, open 9-20,
; customer front door.
(layout ref-park :tags (leisure park village town) :score 1
(let ((w 14) (d 12))
(shell w d :floors 1 :empty)
(floor 0
   (room park1 (rect 0 0 1 1) :type park
         :effects ((money -2) (stress -4)))
   (door front center)
   (windows all))
(roof gable 0 0 w d)
(parking (rect-front-center 5.2 5.2))))

; Hospital (6.8.14): the emergency destination.  The ward heals
; health over time (health:+5/h) via its stat effects; doctors work
; here (6.8.7 rosters); weight 5 so towns reliably carry one for the
; emergency layer.
(layout ref-hospital :tags (commercial hospital village town) :score 5
(let ((w 20) (d 14))
(shell w d :floors 1 :empty)
(floor 0
   (room ward1 (rect 0 0 0.6 1) :type hospital
         :effects ((health 5)))
   (room lobby1 (rect 0.6 0 1 1) :type lobby)
   (connect ward1 lobby1)
   (door front center)
   (door back center)
   (windows all))
(roof flat 0 0 w d)
(parking (rect-front-center 13 5.2))))
