mirror of
https://github.com/jackfoxy/urQL.git
synced 2024-09-11 11:55:33 +03:00
primitive obelisk agent works
This commit is contained in:
parent
7030e15b6c
commit
8ac84c96f4
@ -1,3 +1,4 @@
|
||||
/- *obelisk
|
||||
/+ default-agent, dbug
|
||||
|%
|
||||
+$ versioned-state
|
||||
@ -9,11 +10,9 @@
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
=| state-0
|
||||
=* state -
|
||||
::
|
||||
|
||||
^- agent:gall
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
default ~(. (default-agent this %n) bowl)
|
||||
@ -22,33 +21,32 @@
|
||||
~& > '%obelisk init'
|
||||
=. state [%0 *(list @)]
|
||||
`this
|
||||
::++ on-save !>(state)
|
||||
++ on-save on-save:default
|
||||
::++ on-load |=(vase `..on-init)
|
||||
++ on-load :: on-load:default
|
||||
++ on-save !>(state)
|
||||
++ on-load ::on-load:default
|
||||
|= old=vase
|
||||
^- (quip card _this)
|
||||
`this(state !<(state-0 old))
|
||||
::++ on-poke |=(cage !!)
|
||||
++ on-poke ::on-poke:default
|
||||
++ on-poke :: on-poke:default
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
?> ?=(%charlie-action mark)
|
||||
?> ?=(%obelisk-action mark)
|
||||
=/ act !<(action vase)
|
||||
?- -.act
|
||||
?- -.act
|
||||
%push
|
||||
?: =(our.bowl target.act)
|
||||
`this(values [value.act values])
|
||||
?> =(our.bowl src.bowl)
|
||||
:_ this
|
||||
[%pass /pokes %agent [target.act %charlie] %poke mark vase]~
|
||||
[%pass /pokes %agent [target.act %obelisk] %poke mark vase]~
|
||||
::
|
||||
%pop
|
||||
?: =(our.bowl target.act)
|
||||
`this(values ?~(values ~ t.values))
|
||||
?> =(our.bowl src.bowl)
|
||||
:_ this
|
||||
[%pass /pokes %agent [target.act %charlie] %poke mark vase]~
|
||||
[%pass /pokes %agent [target.act %obelisk] %poke mark vase]~
|
||||
==
|
||||
::++ on-watch |=(path !!)
|
||||
++ on-watch on-watch:default
|
||||
::++ on-leave |=(path `..on-init)
|
@ -1,2 +1,2 @@
|
||||
:~ %obelisk-01
|
||||
:~ %obelisk
|
||||
==
|
||||
|
12
urql/mar/obelisk/action.hoon
Normal file
12
urql/mar/obelisk/action.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
/- *obelisk
|
||||
|_ act=action
|
||||
++ grow
|
||||
|%
|
||||
++ noun act
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ noun action
|
||||
--
|
||||
++ grad %noun
|
||||
--
|
6
urql/sur/obelisk.hoon
Normal file
6
urql/sur/obelisk.hoon
Normal file
@ -0,0 +1,6 @@
|
||||
|%
|
||||
+$ action
|
||||
$% [%push target=@p value=@]
|
||||
[%pop target=@p]
|
||||
==
|
||||
--
|
Loading…
Reference in New Issue
Block a user