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

;; name: entity-table.gc
;; name in dgo: entity-table
;; dgos: ENGINE, GAME

;; DECOMP BEGINS

(define *entity-info* (new 'static 'boxed-array :type entity-info
                        (new 'static 'entity-info
                          :ptype (type-ref stadium-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref citywide-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref ctywide-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref tomb-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref ctyslumb-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref ctygena-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref ctyindb-part :method-count 16)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref jellyfish :method-count 165)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x10000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref widow :method-count 47)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x10000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref nav-graph :method-count 45)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref pal-electric-fan :method-count 21)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x6000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref lurker-pipe-lid :method-count 31)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref ctyn-lamp :method-count 31)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref burning-bush :method-count 33)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref sail-boat-a :method-count 179)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref barge :method-count 149)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref propa :method-count 32)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref city-window-a :method-count 179)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref cty-window-a :method-count 179)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref parking-spot :method-count 25)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref security-wall :method-count 25)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref cty-guard-turret :method-count 36)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref cty-fruit-stand :method-count 30)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref fruit-stand :method-count 30)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref torn :method-count 179)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x4000
                          )
                        (new 'static 'entity-info
                          :ptype (type-ref neon-baron :method-count 17)
                          :package "game"
                          :art-group '()
                          :pool '*16k-dead-pool*
                          :heap-size #x10000
                          )
                        )
        )

;; WARN: Return type mismatch basic vs entity-info.
(defun entity-info-lookup ((arg0 type))
  "Given a type, return the [[entity-info]] from [[*entity-info*]] whos type
matches the `ptype` field.  Set's `method 13` on said type that returns the `length`
off the [[entity-info]]

If nothing matches, set `method 13` to `#f` and return `#f`"
  (the-as entity-info (cond
                        ((nonzero? (-> arg0 method-table 13))
                         (-> arg0 method-table 13)
                         )
                        (else
                          (let ((v1-1 *entity-info*))
                            (dotimes (a1-0 (-> v1-1 length))
                              (when (= arg0 (-> v1-1 a1-0 ptype))
                                (set! (-> arg0 method-table 13) (the-as function (-> v1-1 a1-0)))
                                (return (the-as entity-info (-> v1-1 a1-0)))
                                )
                              )
                            )
                          (set! (-> arg0 method-table 13) #f)
                          (the-as basic #f)
                          )
                        )
          )
  )
