diff options
-rw-r--r-- | Spear/Scene/Scene.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Spear/Scene/Scene.hs b/Spear/Scene/Scene.hs index b58c149..57a9a40 100644 --- a/Spear/Scene/Scene.hs +++ b/Spear/Scene/Scene.hs | |||
@@ -10,6 +10,7 @@ module Spear.Scene.Scene | |||
10 | , Spear.Scene.Scene.filter | 10 | , Spear.Scene.Scene.filter |
11 | -- * Queries | 11 | -- * Queries |
12 | , find | 12 | , find |
13 | , query | ||
13 | -- * Update and render | 14 | -- * Update and render |
14 | , update | 15 | , update |
15 | , updateM | 16 | , updateM |
@@ -75,6 +76,11 @@ find :: (obj -> Bool) -> Scene obj -> Maybe obj | |||
75 | find pred (scene@ListScene {}) = L.find pred $ objects scene | 76 | find pred (scene@ListScene {}) = L.find pred $ objects scene |
76 | 77 | ||
77 | 78 | ||
79 | -- | Return all objects that satisfy the given predicate. | ||
80 | query :: (obj -> Bool) -> Scene obj -> [obj] | ||
81 | query pred (scene@ListScene {}) = L.filter pred $ objects scene | ||
82 | |||
83 | |||
78 | type Update obj = obj -> obj | 84 | type Update obj = obj -> obj |
79 | 85 | ||
80 | 86 | ||