test/chimaera.sod: Make `Serpent' tickle tolerance be a slot.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 5 Jan 2016 17:18:27 +0000 (17:18 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 13:40:40 +0000 (14:40 +0100)
No observable change (because nothing writes the slot).

test/chimaera.sod

index 644bb74..6d62fb6 100644 (file)
@@ -31,11 +31,15 @@ class Goat : Animal {
 }
 
 class Serpent : Animal {
+  int limit = 2;
+
   void hiss() { puts("Sssss!"); }
   void bite() { puts("Nom!"); }
   void nml.tickle() {
-    if (SERPENT__CONV_NML(me)->nml.tickles <= 2) Serpent_hiss(me);
-    else Serpent_bite(me);
+    if (SERPENT__CONV_NML(me)->nml.tickles <= me->serpent.limit)
+      Serpent_hiss(me);
+    else
+      Serpent_bite(me);
   }
 }