diff options
Diffstat (limited to 'HsBot/IRC/User.hs')
| -rw-r--r-- | HsBot/IRC/User.hs | 28 |
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) + |
