;;; This file holds procedures for debugging species.lisp

;;; For debugging
(defun make-ex ()
  (let ((dude (svref (location-orgs (aref *env* 0 0)) 0)))
    (setf (organism-alive dude) t)
    (incf (location-num-orgs (aref *env* 0 0)))
    (setf (organism-phenotype dude) 0)
    (setf (organism-prey dude) 0)
    (setf (organism-generalism dude) 0)
    (setf *dude* dude)))

;;; For debugging.
(defun print-ex () (print-org (svref (location-orgs (aref *env* 0 0)) 0)))

(defun clear-autotrophs ()
  (dotimes (y YDIM)
     (dotimes (x XDIM)
	(let ((loc (aref *env* x y)))
	  (setf (location-num-food loc) 0)
	  (let ((orgs (location-orgs loc)))
	    (dotimes (i MAX-FOOD-CAPACITY)
	       (setf (organism-alive (svref orgs i)) ())))))))

(defun print-autotrophs (x y)
  (let ((orgs (location-orgs (aref *env* x y)))
	(num-food (location-num-food (aref *env* x y))))
    (format t "[~a Plants] " num-food)
    (dotimes (i num-food)
       (format t "~a " (organism-phenotype (svref orgs i))))))

(defun print-first-plant (loc)
  (organism-phenotype (svref (location-orgs loc) 0)))

