summaryrefslogtreecommitdiff
path: root/HsBot/Logics
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/Logics
parent4d5291b0a054c26f3c55ece0dbd837590bc82bd3 (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@47 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'HsBot/Logics')
-rw-r--r--HsBot/Logics/AI.hs6
-rw-r--r--HsBot/Logics/IRCKarma.hs27
2 files changed, 27 insertions, 6 deletions
diff --git a/HsBot/Logics/AI.hs b/HsBot/Logics/AI.hs
deleted file mode 100644
index 9deaca4..0000000
--- a/HsBot/Logics/AI.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module HsBot.AI (aiRun) where
-
-import HsBot.Env
-
-aiRun :: String -> Env -> IO Env
-aiRun str env = return (env)
diff --git a/HsBot/Logics/IRCKarma.hs b/HsBot/Logics/IRCKarma.hs
new file mode 100644
index 0000000..55c74d7
--- /dev/null
+++ b/HsBot/Logics/IRCKarma.hs
@@ -0,0 +1,27 @@
+module HsBot.Logics.IrcKarma where
+
+import HsBot.Env
+import HsBot.Logics
+
+data Karma = Karma {
+ karmaName :: String,
+ minPts :: Int,
+ minPerc :: Float
+ } deriving (Show, Read)
+
+instance Eq Karma where
+ x == y = (minPerc x) == (minPerc y) && (minPts x == minPts y)
+
+instance Ord Karma where
+ x > y
+ | (minPerc x) > (minPerc y) = True
+ | otherwise = (minPts x) > (minPts y)
+ x < y
+ | (minPerc x) < (minPerc y) = True
+ | otherwise = (minPts x) < (minPts y)
+ x >= y = not (x < y)
+ x <= y = not (x > y)
+
+instance Logics Karma where
+ logicsRun str env = return (env)
+