clay

Hex Artifact Content
Login
Become a Patron!

Artifact f796ffbc46765a63ba3bcce29e0a4e066493c702ea8a022395eea2002e8900aa:


0000: 63 6c 61 79 3a 3a 64 65 66 69 6e 65 20 3a 3a 73  clay::define ::s
0010: 74 61 67 65 3a 3a 70 72 6f 70 20 7b 0a 0a 7d 0a  tage::prop {..}.
0020: 0a 63 6c 61 79 3a 3a 64 65 66 69 6e 65 20 3a 3a  .clay::define ::
0030: 73 74 61 67 65 3a 3a 69 74 65 6d 20 7b 0a 0a 20  stage::item {.. 
0040: 20 49 4e 54 45 52 41 43 54 20 54 41 4b 45 20 7b   INTERACT TAKE {
0050: 0a 20 20 20 20 73 65 74 20 64 65 73 63 72 69 70  .    set descrip
0060: 74 69 6f 6e 20 5b 6d 79 20 73 74 61 74 65 20 67  tion [my state g
0070: 65 74 20 64 65 73 63 72 69 70 74 69 6f 6e 5d 0a  et description].
0080: 20 20 20 20 64 69 63 74 20 73 65 74 20 72 65 70      dict set rep
0090: 6c 79 20 63 6f 64 65 20 6f 6b 0a 20 20 20 20 64  ly code ok.    d
00a0: 69 63 74 20 73 65 74 20 72 65 70 6c 79 20 6f 62  ict set reply ob
00b0: 6a 65 63 74 20 5b 6d 79 20 75 75 69 64 5d 0a 20  ject [my uuid]. 
00c0: 20 20 20 69 66 20 7b 5b 6d 79 20 73 74 61 74 65     if {[my state
00d0: 20 6c 6f 63 61 74 69 6f 6e 5d 7d 0a 20 20 20 20   location]}.    
00e0: 69 66 20 7b 24 64 65 73 63 72 69 70 74 69 6f 6e  if {$description
00f0: 20 6e 65 20 7b 7d 7d 20 7b 0a 20 20 20 20 20 20   ne {}} {.      
0100: 64 69 63 74 20 73 65 74 20 72 65 70 6c 79 20 63  dict set reply c
0110: 6f 6e 74 65 6e 74 20 24 64 65 73 63 72 69 70 74  ontent $descript
0120: 69 6f 6e 0a 20 20 20 20 20 20 72 65 74 75 72 6e  ion.      return
0130: 20 24 72 65 70 6c 79 0a 20 20 20 20 7d 0a 20 20   $reply.    }.  
0140: 20 20 73 65 74 20 6e 61 6d 65 20 5b 6d 79 20 73    set name [my s
0150: 74 61 74 65 20 67 65 74 20 6e 61 6d 65 5d 0a 20  tate get name]. 
0160: 20 20 20 69 66 20 7b 24 6e 61 6d 65 20 6e 65 20     if {$name ne 
0170: 7b 7d 7d 20 7b 0a 20 20 20 20 20 20 64 69 63 74  {}} {.      dict
0180: 20 73 65 74 20 72 65 70 6c 79 20 63 6f 6e 74 65   set reply conte
0190: 6e 74 20 24 6e 61 6d 65 0a 20 20 20 20 20 20 72  nt $name.      r
01a0: 65 74 75 72 6e 20 24 72 65 70 6c 79 0a 20 20 20  eturn $reply.   
01b0: 20 7d 0a 20 20 20 20 64 69 63 74 20 73 65 74 20   }.    dict set 
01c0: 72 65 70 6c 79 20 63 6f 6e 74 65 6e 74 20 5b 6d  reply content [m
01d0: 79 20 75 75 69 64 5d 0a 20 20 20 20 72 65 74 75  y uuid].    retu
01e0: 72 6e 20 24 72 65 70 6c 79 0a 20 20 7d 0a 0a 7d  rn $reply.  }..}
01f0: 0a 0a 63 6c 61 79 3a 3a 64 65 66 69 6e 65 20 3a  ..clay::define :
0200: 3a 73 74 61 67 65 3a 3a 69 74 65 6d 2e 74 72 65  :stage::item.tre
0210: 61 73 75 72 65 20 7b 0a 20 20 73 75 70 65 72 63  asure {.  superc
0220: 6c 61 73 73 20 3a 3a 73 74 61 67 65 3a 3a 69 74  lass ::stage::it
0230: 65 6d 0a 7d 0a                                   em.}.