X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fnvm%2Fagent.lisp;h=e20efa20fcbd4f39233e14572cc311244b944de4;hp=8e97ea002c5bdf5ff4c06e12c8cd5a2b04ef9283;hb=89cb3482de1fefc2d8e5f67e1e04a0790e8cd243;hpb=31f7cb69edd16f175430851d696b1036b07b60f1 diff --git a/src/main/nvm/agent.lisp b/src/main/nvm/agent.lisp index 8e97ea0..e20efa2 100644 --- a/src/main/nvm/agent.lisp +++ b/src/main/nvm/agent.lisp @@ -38,6 +38,12 @@ DESCRIPTION: ; Don't want the setter for :who (defmethod agent-value-inner ((turtle turtle) (var (eql :who))) (turtle-who turtle)) +(defmethod agent-value-inner ((turtle turtle) (var (eql :pcolor))) + (patch-color (patch-at (turtle-xcor turtle) (turtle-ycor turtle)))) + +(defmethod set-agent-value-inner ((turtle turtle) (var (eql :pcolor)) new-val) + (setf (patch-color (patch-at (turtle-xcor turtle) (turtle-ycor turtle))) new-val)) + (defagent-value patch :pcolor patch-color) (defagent-value turtle :color)