From faee74399231b64e2172024fd2a1b407c72b5dc2 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Fri, 4 Jul 2008 23:29:15 +0000 Subject: [PATCH] Reordeing of code --- Partty.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Partty.hs b/Partty.hs index 4fafbef..a8ebcac 100644 --- a/Partty.hs +++ b/Partty.hs @@ -187,8 +187,7 @@ getNextUserMessage h ps = do DayMessage dm -> return (Left dm, ps') NightMessage nm -> return (Right nm, ps') -updateState :: IncomingMessage -> ParttyState -> ParttyState -updateState msg ps = ps -- TODO: this is a stub +-- Message parsing parseIncomingMessage :: String -> IncomingMessage parseIncomingMessage msg = case id of @@ -241,6 +240,11 @@ sendClientMessage h msg = do putStrLn $ "Client says: " ++ (show msg) toString (Tell player (Liar other)) = unwords ["liar", show player, show other] toString (Tell player (NoLiar other)) = unwords ["recommand",show player, show other] +-- Bookkeeping + +updateState :: IncomingMessage -> ParttyState -> ParttyState +updateState msg ps = ps -- TODO: this is a stub + -- Convenience functions for accessing the state -- 2.20.1