diff --git a/src/Classes/Physics/Collectable.hs b/src/Classes/Physics/Collectable.hs new file mode 100644 index 0000000..b12585d --- /dev/null +++ b/src/Classes/Physics/Collectable.hs @@ -0,0 +1,23 @@ +module Classes.Physics.Collectable where + +-- | All kinds of Effects present in the game +data Effect + = HealthUp + | SpeedUp + | JumpUp + | ArmorUp + | Antidote + | StopTime + | Invisibility + +-- | The Effect holder type definition +data EffectHolder = EffectHolder + { effectDuration :: Double -- ^ Duration of stored effect + , effectReleased :: Effect -- ^ The actual effect released + } + +class Collidible c => Collectable c where + + effect + :: c -- ^ Collectable object + -> EffectHolder -- ^ The descriptor of the effect contained diff --git a/src/Types/Tangible.hs b/src/Types/Tangible.hs index fa51ee0..76db1af 100644 --- a/src/Types/Tangible.hs +++ b/src/Types/Tangible.hs @@ -1,4 +1,4 @@ {-# LANGUAGE ExistentialQuantification #-} module Types.Tangible where -data Tangible = forall a . Collidible a => Tangible a +data Tangible = forall a . Collectable a => Tangible a