summaryrefslogtreecommitdiffstats
path: root/src/Debris.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-03-15 14:46:14 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-03-15 14:46:14 +0100
commit90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f (patch)
tree35f51096c034e881198447671896535dafcdbe69 /src/Debris.hs
parente85dc20a4869c91faa3869695d2d19bfe07f9abc (diff)
downloadhtanks-90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f.tar
htanks-90b8d87e02bfb0d1d3d10c3b824df8fd8ce37a9f.zip
Reorganized code to add Debris class
Diffstat (limited to 'src/Debris.hs')
-rw-r--r--src/Debris.hs21
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