nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d380fed
)
gamnit: make SpriteSet behave more like a Set
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 24 Mar 2017 00:26:04 +0000
(20:26 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 27 Mar 2017 13:24:45 +0000
(09:24 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/flat.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/flat.nit
b/lib/gamnit/flat.nit
index
7c2db7e
..
d5cb28e
100644
(file)
--- a/
lib/gamnit/flat.nit
+++ b/
lib/gamnit/flat.nit
@@
-654,6
+654,7
@@
private class SpriteSet
redef fun add(e)
do
+ if contexts_items.has(e.context) then return
map_sprite e
super
end
@@
-664,6
+665,12
@@
private class SpriteSet
if e isa Sprite then unmap_sprite e
end
+ redef fun remove_all(e)
+ do
+ if not has(e) then return
+ remove e
+ end
+
redef fun clear
do
super