diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-03-15 14:46:14 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-03-15 14:46:14 +0100 |
commit | 90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f (patch) | |
tree | 35f51096c034e881198447671896535dafcdbe69 /src/Debris.hs | |
parent | e85dc20a4869c91faa3869695d2d19bfe07f9abc (diff) | |
download | htanks-90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f.tar htanks-90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f.zip |
Reorganized code to add Debris class
Diffstat (limited to 'src/Debris.hs')
-rw-r--r-- | src/Debris.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Debris.hs b/src/Debris.hs new file mode 100644 index 0000000..40b7def --- /dev/null +++ b/src/Debris.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE ExistentialQuantification #-} + +module Debris ( Debris(..) + , SomeDebris(..) + ) where + +import Tank + +class Show a => Debris a where + collideTank :: a -> Tank -> Tank + + +data SomeDebris = forall a. Debris a => SomeDebris a + +instance Show SomeDebris + where + show (SomeDebris a) = show a + +instance Debris SomeDebris + where + collideTank (SomeDebris a) = collideTank a |