;;-*-Lisp-*-
(in-package goal)

;; definition for symbol *generate-actor-vis*, type symbol
(define *generate-actor-vis* #f)

;; definition for symbol *generate-actor-vis-start*, type symbol
(define *generate-actor-vis-start* #f)

;; definition for symbol *generate-actor-vis-output*, type symbol
(define *generate-actor-vis-output* #f)

;; definition of type entity-perm
(deftype entity-perm (structure)
  ((user-object object             2 :offset-assert   0)
   (user-uint64 uint64               :offset          0)
   (user-float  float              2 :offset          0)
   (user-int32  int32              2 :offset          0)
   (user-uint32 uint32             2 :offset          0)
   (user-int16  int16              4 :offset          0)
   (user-uint16 uint16             4 :offset          0)
   (user-int8   int8               8 :offset          0)
   (user-uint8  uint8              8 :offset          0)
   (status      entity-perm-status   :offset-assert   8)
   (dummy       uint8              1 :offset-assert  10)
   (task        game-task            :offset-assert  11)
   (aid         actor-id             :offset-assert  12)
   (quad        uint128              :offset          0)
   )
  :pack-me
  :method-count-assert 10
  :size-assert         #x10
  :flag-assert         #xa00000010
  (:methods
    (update-perm! (_type_ symbol entity-perm-status) _type_ 9)
    )
  )

;; definition for method 3 of type entity-perm
;; INFO: Used lq/sq
(defmethod inspect entity-perm ((obj entity-perm))
  (format #t "[~8x] ~A~%" obj 'entity-perm)
  (format #t "~Tuser-object[2] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-uint64: ~D~%" (-> obj user-uint64))
  (format #t "~Tuser-float[2] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-int32[2] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-uint32[2] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-int16[4] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-uint16[4] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-int8[8] @ #x~X~%" (-> obj user-object))
  (format #t "~Tuser-uint8[8] @ #x~X~%" (-> obj user-object))
  (format #t "~Tstatus: ~D~%" (-> obj status))
  (format #t "~Tdummy[1] @ #x~X~%" (-> obj dummy))
  (format #t "~Ttask: ~D~%" (-> obj task))
  (format #t "~Taid: ~D~%" (-> obj aid))
  (format #t "~Tquad: ~D~%" (-> obj quad))
  obj
  )

;; definition of type entity-links
(deftype entity-links (structure)
  ((prev-link entity-links         :offset-assert   0)
   (next-link entity-links         :offset-assert   4)
   (entity    entity               :offset-assert   8)
   (process   process              :offset-assert  12)
   (level     level                :offset-assert  16)
   (vis-id    int32                :offset-assert  20)
   (trans     vector       :inline :offset-assert  32)
   (perm      entity-perm  :inline :offset-assert  48)
   (status    uint16               :offset         56)
   (aid       actor-id             :offset         60)
   (task      game-task            :offset         59)
   )
  :method-count-assert 10
  :size-assert         #x40
  :flag-assert         #xa00000040
  (:methods
    (birth? (_type_ vector) symbol 9)
    )
  )

;; definition for method 3 of type entity-links
(defmethod inspect entity-links ((obj entity-links))
  (format #t "[~8x] ~A~%" obj 'entity-links)
  (format #t "~Tprev-link: #<entity-links @ #x~X>~%" (-> obj prev-link))
  (format #t "~Tnext-link: #<entity-links @ #x~X>~%" (-> obj next-link))
  (format #t "~Tentity: ~A~%" (-> obj entity))
  (format #t "~Tprocess: ~A~%" (-> obj process))
  (format #t "~Tlevel: ~A~%" (-> obj level))
  (format #t "~Tvis-id: ~D~%" (-> obj vis-id))
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Tperm: ~`entity-perm`P~%" (-> obj perm))
  (format #t "~Tstatus: ~D~%" (-> obj perm status))
  (format #t "~Taid: ~D~%" (-> obj perm aid))
  (format #t "~Ttask: ~D~%" (-> obj perm task))
  obj
  )

;; definition of type entity-perm-array
(deftype entity-perm-array (inline-array-class)
  ((data entity-perm :inline :dynamic :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type entity-perm-array
(defmethod inspect entity-perm-array ((obj entity-perm-array))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tlength: ~D~%" (-> obj length))
  (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
  (format #t "~Tdata[0] @ #x~X~%" (-> obj data))
  obj
  )

;; failed to figure out what this is:
(set! (-> entity-perm-array heap-base) (the-as uint 16))

;; definition of type entity-links-array
(deftype entity-links-array (inline-array-class)
  ((data entity-links :inline :dynamic :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type entity-links-array
(defmethod inspect entity-links-array ((obj entity-links-array))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tlength: ~D~%" (-> obj length))
  (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
  (format #t "~Tdata[0] @ #x~X~%" (-> obj data))
  obj
  )

;; failed to figure out what this is:
(set! (-> entity-links-array heap-base) (the-as uint 64))

;; definition of type entity
(deftype entity (res-lump)
  ((trans vector :inline :offset-assert  32)
   (aid   uint32         :offset-assert  48)
   )
  :method-count-assert 27
  :size-assert         #x34
  :flag-assert         #x1b00000034
  (:methods
    (birth! (_type_) _type_ 22)
    (kill! (_type_) _type_ 23)
    (add-to-level! (_type_ level-group level actor-id) none 24)
    (remove-from-level! (_type_ level-group) _type_ 25)
    (get-level (_type_) level 26)
    )
  )

;; definition of type entity-camera
(deftype entity-camera (entity)
  ((connect connectable :inline :offset-assert  64)
   )
  :method-count-assert 27
  :size-assert         #x50
  :flag-assert         #x1b00000050
  )

;; definition of type entity-ambient-data
(deftype entity-ambient-data (structure)
  ((user-object object                                  3  :offset-assert   0)
   (function    (function drawable-ambient vector none)    :offset-assert  12)
   (quad        uint128                                    :offset          0)
   (user-uint64 uint64                                  1  :offset          0)
   (user-float  float                                   3  :offset          0)
   (user-int32  int32                                   3  :offset          0)
   (user-uint32 uint32                                  3  :offset          0)
   (user-int16  int16                                   6  :offset          0)
   (user-uint16 uint16                                  6  :offset          0)
   (user-int8   int8                                    12 :offset          0)
   (user-uint8  uint8                                   12 :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type entity-ambient-data
;; INFO: Used lq/sq
(defmethod inspect entity-ambient-data ((obj entity-ambient-data))
  (format #t "[~8x] ~A~%" obj 'entity-ambient-data)
  (format #t "~Tuser-object[3] @ #x~X~%" (&-> obj quad))
  (format #t "~Tfunction: ~A~%" (-> obj function))
  (format #t "~Tquad: ~D~%" (-> obj quad))
  (format #t "~Tuser-uint64[1] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-float[3] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-int32[3] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-uint32[3] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-int16[6] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-uint16[6] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-int8[12] @ #x~X~%" (&-> obj quad))
  (format #t "~Tuser-uint8[12] @ #x~X~%" (&-> obj quad))
  obj
  )

;; definition of type entity-ambient-data-array
(deftype entity-ambient-data-array (inline-array-class)
  ((data entity-ambient-data :inline :dynamic :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type entity-ambient-data-array
(defmethod inspect entity-ambient-data-array ((obj entity-ambient-data-array))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tlength: ~D~%" (-> obj length))
  (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
  (format #t "~Tdata[0] @ #x~X~%" (-> obj data))
  obj
  )

;; failed to figure out what this is:
(set! (-> entity-ambient-data-array heap-base) (the-as uint 16))

;; definition of type entity-ambient
(deftype entity-ambient (entity)
  ((ambient-data entity-ambient-data  :offset  24)
   )
  :method-count-assert 29
  :size-assert         #x34
  :flag-assert         #x1d00000034
  (:methods
    (draw-debug (_type_) none 27)
    (birth-ambient! (_type_) none 28)
    )
  )

;; definition of type entity-actor
(deftype entity-actor (entity)
  ((nav-mesh      nav-mesh           :offset-assert  52)
   (etype         type               :offset-assert  56)
   (task          game-task          :offset-assert  60)
   (vis-id        uint16             :offset-assert  62)
   (vis-id-signed int16              :offset         62)
   (quat          quaternion :inline :offset-assert  64)
   )
  :method-count-assert 31
  :size-assert         #x50
  :flag-assert         #x1f00000050
  (:methods
    (next-actor (_type_) entity-actor 27)
    (prev-actor (_type_) entity-actor 28)
    (debug-print (_type_ symbol type) none 29)
    (dummy-30 (_type_ entity-perm-status symbol) none 30)
    )
  )

;; definition of type entity-info
(deftype entity-info (basic)
  ((ptype     type   :offset-assert   4)
   (package   basic  :offset-assert   8)
   (art-group pair   :offset-assert  12)
   (pool      basic  :offset-assert  16)
   (heap-size int32  :offset-assert  20)
   )
  :method-count-assert 9
  :size-assert         #x18
  :flag-assert         #x900000018
  )

;; definition for method 3 of type entity-info
(defmethod inspect entity-info ((obj entity-info))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tptype: ~A~%" (-> obj ptype))
  (format #t "~Tpackage: ~A~%" (-> obj package))
  (format #t "~Tart-group: ~A~%" (-> obj art-group))
  (format #t "~Tpool: ~A~%" (-> obj pool))
  (format #t "~Theap-size: ~D~%" (-> obj heap-size))
  obj
  )

;; failed to figure out what this is:
(if (zero? entity-nav-login)
    (set! entity-nav-login (the-as (function entity-actor none) nothing))
    )

;; definition of type actor-bank
(deftype actor-bank (basic)
  ((pause-dist float  :offset-assert   4)
   (birth-dist float  :offset-assert   8)
   (birth-max  int32  :offset-assert  12)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type actor-bank
(defmethod inspect actor-bank ((obj actor-bank))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tpause-dist: ~f~%" (-> obj pause-dist))
  (format #t "~Tbirth-dist: ~f~%" (-> obj birth-dist))
  (format #t "~Tbirth-max: ~D~%" (-> obj birth-max))
  obj
  )

;; definition for symbol *ACTOR-bank*, type actor-bank
(define *ACTOR-bank* (new 'static 'actor-bank :pause-dist 204800.0 :birth-dist 901120.0 :birth-max 10))

;; failed to figure out what this is:
0
