From a20d05376cb2de636abebd64da3eeb6c7e8c7bac Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 29 Oct 2022 21:40:09 -0400 Subject: Day 1 progress. --- apple-town-fair/place.scm | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'apple-town-fair/place.scm') diff --git a/apple-town-fair/place.scm b/apple-town-fair/place.scm index 45534a9..2cfb5ed 100644 --- a/apple-town-fair/place.scm +++ b/apple-town-fair/place.scm @@ -14,13 +14,37 @@ ;;; along with this program. If not, see ;;; . (define-module (apple-town-fair place) + #:use-module (catbird config) #:use-module (catbird node) #:use-module (catbird node-2d) #:use-module (oop goops) - #:export ()) + #:export ( + condition + duration + exec + performable? + perform + + title + actions)) + +(define-root-class () + (name #:accessor name #:init-keyword #:name) + (condition #:accessor condition #:init-keyword #:condition + #:init-form (const #t)) + (exec #:accessor exec #:init-keyword #:exec) + (duration #:accessor duration #:init-keyword #:duration #:init-value 1)) + +(define-method (performable? (action ) state) + ((condition action) state)) + +(define-method (perform (action ) state) + ((exec action) state)) (define-class () - (background #:accessor background #:init-keyword #:background)) + (title #:accessor title #:init-keyword #:title #:init-value "Unknown") + (background #:accessor background #:init-keyword #:background) + (actions #:accessor actions #:init-keyword #:actions #:init-value '())) (define-method (on-boot (place )) (attach-to place -- cgit v1.2.3