aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Spear/Scene/Scene.hs6
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
75find pred (scene@ListScene {}) = L.find pred $ objects scene 76find pred (scene@ListScene {}) = L.find pred $ objects scene
76 77
77 78
79-- | Return all objects that satisfy the given predicate.
80query :: (obj -> Bool) -> Scene obj -> [obj]
81query pred (scene@ListScene {}) = L.filter pred $ objects scene
82
83
78type Update obj = obj -> obj 84type Update obj = obj -> obj
79 85
80 86