From 2499fe526a0987016fed565e1a7e29c708600c4a Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 29 Jul 2017 02:20:32 +0200 Subject: [PATCH] show everything --- src/Affection/Actor.hs | 14 +++++++------- src/Affection/Animation.hs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Affection/Actor.hs b/src/Affection/Actor.hs index e7dff80..cff094f 100644 --- a/src/Affection/Actor.hs +++ b/src/Affection/Actor.hs @@ -18,19 +18,19 @@ import qualified Control.Monad.Parallel as MP import Affection.Types -data Ord a => Actor a = Actor +data (Show a, Ord a) => Actor a = Actor { actorProperties :: [ActorProperty a] , actorNodes :: M.Map a G.GeglNode , actorFlange :: G.GeglNode - } deriving (Eq) + } deriving (Show, Eq) -data Ord a => ActorProperty a = ActorProperty +data (Show a, Ord a) => ActorProperty a = ActorProperty { apName :: String , apValue :: G.PropertyValue , apMapping :: Maybe (a, String) - } deriving (Eq) + } deriving (Show, Eq) -updateProperties :: Ord a => [G.Property] -> Actor a -> Actor a +updateProperties :: (Show a, Ord a) => [G.Property] -> Actor a -> Actor a updateProperties ps act@Actor{..} = act { actorProperties = @@ -46,7 +46,7 @@ updateProperties ps act@Actor{..} = | apName p == n = p | otherwise = getProp' n ps -applyProperties :: Ord a => Actor a -> Affection us () +applyProperties :: (Show a, Ord a) => Actor a -> Affection us () applyProperties Actor{..} = MP.mapM_ (\(ActorProperty{..}) -> maybe (return ()) (\m -> @@ -55,7 +55,7 @@ applyProperties Actor{..} = ) apMapping ) actorProperties -getProperty :: Ord a => String -> Actor a -> Maybe G.PropertyValue +getProperty :: (Show a, Ord a) => String -> Actor a -> Maybe G.PropertyValue getProperty name act = case find (\a -> name == apName a) $ actorProperties act of Just p -> Just $ apValue p diff --git a/src/Affection/Animation.hs b/src/Affection/Animation.hs index 0bafb9f..87d2e8a 100644 --- a/src/Affection/Animation.hs +++ b/src/Affection/Animation.hs @@ -23,7 +23,7 @@ data SpriteAnimation = SpriteAnimation } runAnimation - :: Ord a + :: (Show a, Ord a) => Actor a -> SpriteAnimation -> Affection us (SpriteAnimation, Actor a)