Handbook
Glossary
grid-gadget
Vocabulary
minesweeper
Definition
USING:
ui.gadgets
;
IN:
minesweeper
TUPLE:
grid-gadget
<
gadget
cells timer textures start end hint?
;
Methods
USING:
accessors
combinators
minesweeper
ui.render
;
M:
grid-gadget
draw-gadget*
{
[
draw-hint
]
[
cells>>
#mines-remaining
]
[
draw-mines
]
[
draw-smiley
]
[
elapsed-time
]
[
draw-timer
]
[
draw-cells
]
}
cleave
;
USING:
accessors
generic
kernel
minesweeper
timers
ui.gadgets
;
M:
grid-gadget
graft*
[
timer>>
start-timer
]
[
M\
grid-gadget
graft*
(call-next-method)
]
bi
;
USING:
accessors
circular
combinators.short-circuit
generic
kernel
minesweeper
sequences
ui.gestures
;
M:
grid-gadget
handle-gesture
over
{
[
key-down?
]
[
sym>>
length
1
=
]
[
sym>>
" "
=
not
]
}
1&&
[
2dup
[
sym>>
first
]
[
hint?>>
]
bi*
circular-push
]
when
M\
grid-gadget
handle-gesture
(call-next-method)
;
USING:
accessors
arrays
kernel
math
minesweeper
ui.gadgets
;
M:
grid-gadget
pref-dim*
cells>>
cells-dim
[
32
*
]
bi@
swap
58
+
2array
;
USING:
accessors
assocs
destructors
generic
kernel
minesweeper
timers
ui.gadgets
ui.gadgets.worlds
;
M:
grid-gadget
ungraft*
[
dup
find-gl-context
[
values
dispose-each
H{
}
clone
]
change-textures
timer>>
stop-timer
]
[
M\
grid-gadget
ungraft*
(call-next-method)
]
bi
;