summaryrefslogtreecommitdiff
path: root/HsBot
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
parent4d5291b0a054c26f3c55ece0dbd837590bc82bd3 (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@47 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'HsBot')
-rw-r--r--HsBot/AI.hs6
-rw-r--r--HsBot/IRC/Connection.hs (renamed from HsBot/IRC.hs)4
-rw-r--r--HsBot/IRC/User.hs (renamed from HsBot/User.hs)0
-rw-r--r--HsBot/Logics.hs10
-rw-r--r--HsBot/Logics/AI.hs6
-rw-r--r--HsBot/Logics/IRCKarma.hs (renamed from HsBot/Karma.hs)8
-rw-r--r--HsBot/Start.hs6
7 files changed, 22 insertions, 18 deletions
diff --git a/HsBot/AI.hs b/HsBot/AI.hs
deleted file mode 100644
index 9deaca4..0000000
--- a/HsBot/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/IRC.hs b/HsBot/IRC/Connection.hs
index 28fc9f0..c4fa7a9 100644
--- a/HsBot/IRC.hs
+++ b/HsBot/IRC/Connection.hs
@@ -1,4 +1,4 @@
-module HsBot.IRC (ircStart) where
+module HsBot.IRC.IRConnection (ircStart) where
import IO
import List
@@ -11,7 +11,7 @@ import HsBot.Conf
import HsBot.Env
import HsBot.State
import HsBot.Tools
-import HsBot.User
+import HsBot.IRC.User
data IrcMessage = IrcMessage {
raw :: String,
diff --git a/HsBot/User.hs b/HsBot/IRC/User.hs
index cd6d55f..cd6d55f 100644
--- a/HsBot/User.hs
+++ b/HsBot/IRC/User.hs
diff --git a/HsBot/Logics.hs b/HsBot/Logics.hs
new file mode 100644
index 0000000..5b534e5
--- /dev/null
+++ b/HsBot/Logics.hs
@@ -0,0 +1,10 @@
+module HsBot.Logics (logicsRun) where
+
+import HsBot.Env
+import HsBot.Logics.IRCKarma
+
+class Logics where
+ logicRun :: String -> Env -> IO Env
+
+logicsRun :: String -> Env -> IO Env
+logicsRun str env = return (env)
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/Karma.hs b/HsBot/Logics/IRCKarma.hs
index 939b782..55c74d7 100644
--- a/HsBot/Karma.hs
+++ b/HsBot/Logics/IRCKarma.hs
@@ -1,4 +1,7 @@
-module HsBot.Karma where
+module HsBot.Logics.IrcKarma where
+
+import HsBot.Env
+import HsBot.Logics
data Karma = Karma {
karmaName :: String,
@@ -19,3 +22,6 @@ instance Ord Karma where
x >= y = not (x < y)
x <= y = not (x > y)
+instance Logics Karma where
+ logicsRun str env = return (env)
+
diff --git a/HsBot/Start.hs b/HsBot/Start.hs
index cf87404..3ea4d1e 100644
--- a/HsBot/Start.hs
+++ b/HsBot/Start.hs
@@ -2,11 +2,11 @@ module HsBot.Start (start) where
import System
-import HsBot.AI
import HsBot.Cmd
import HsBot.Conf
import HsBot.Env
-import HsBot.IRC
+import HsBot.IRC.Connection
+import HsBot.Logics
import HsBot.State
import HsBot.Tools
@@ -27,7 +27,7 @@ dispatch msg sendMessage env@(Env state conf) = dispatch' msg
cmdAction state
return (env)
Nothing -> return (env)
- dispatch' _ = aiRun msg env
+ dispatch' _ = logicsRun msg env
commands = [
Cmd "!h" "Prints help" printHelp,
Cmd "!i" "Prints infos" printInfos,