summaryrefslogtreecommitdiff
path: root/HsBot/IRC/User.hs
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-28 10:55:24 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-28 10:55:24 +0000
commit08e80e41af814eb3d6bc21c72e0830f0fc1e8c6c (patch)
tree43f2235ed1b39bfd1c9c469dae8dbd45b99f1578 /HsBot/IRC/User.hs
parent4d5291b0a054c26f3c55ece0dbd837590bc82bd3 (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@47 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'HsBot/IRC/User.hs')
-rw-r--r--HsBot/IRC/User.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/HsBot/IRC/User.hs b/HsBot/IRC/User.hs
new file mode 100644
index 0000000..cd6d55f
--- /dev/null
+++ b/HsBot/IRC/User.hs
@@ -0,0 +1,28 @@
+module HsBot.User where
+
+import List
+
+import HsBot.Karma
+import HsBot.Render
+
+data User = User {
+ userName :: String,
+ userPts :: Int
+ } deriving (Show, Read)
+
+instance Eq User where
+ x == y = (userPts x) == (userPts y)
+
+instance Ord User where
+ x < y = (userPts x) < (userPts y)
+ x > y = (userPts x) > (userPts y)
+ x >= y = not (x < y)
+ x <= y = not (x > y)
+
+instance Render User where
+ render user = userName user ++ ": " ++
+ (show $ userPts user) ++ "pts"
+
+userEquals :: User -> User -> Bool
+userEquals x y = (userName x) == (userName y)
+