Files

73 lines
1.9 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type simple-focus
(deftype simple-focus (process-focusable)
((first-time? symbol)
)
(:state-methods
idle
)
)
;; definition for method 3 of type simple-focus
(defmethod inspect ((this simple-focus))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-focusable inspect)))
(t9-0 this)
)
(format #t "~2Tfirst-time?: ~A~%" (-> this first-time?))
(label cfg-4)
this
)
;; definition for method 20 of type simple-focus
(defmethod get-trans ((this simple-focus) (arg0 int))
"@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])"
(-> this root trans)
)
;; definition for method 12 of type simple-focus
(defmethod run-logic? ((this simple-focus))
"Should this process be run? Checked by execute-process-tree."
(when (-> this first-time?)
(set! (-> this first-time?) #f)
#t
)
)
;; failed to figure out what this is:
(defstate idle (simple-focus)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('move-trans)
(let ((v0-0 (-> self root trans)))
(set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad))
v0-0
)
)
)
)
:code sleep-code
)
;; definition for function simple-focus-init-by-other
;; WARN: Return type mismatch object vs none.
(defbehavior simple-focus-init-by-other simple-focus ()
"Initializes the new [[simple-focus]]. `first-time?` will be set to [[#t]]"
(let ((root (new 'process 'trsqv)))
(set! (-> self root) (the-as collide-shape root))
(vector-identity! (-> root scale))
(quaternion-identity! (-> root quat))
)
(logclear! (-> self mask) (process-mask enemy))
(set! (-> self first-time?) #t)
(set! (-> self event-hook) (-> (method-of-object self idle) event))
(go-virtual idle)
(none)
)