Permalink
Browse files

Cleanup to bump to 0.2.2

  • Loading branch information...
1 parent d1d8d78 commit df9736de646f73481e0291666b3cdd20fbd1e475 @clanehin committed Aug 9, 2008
Showing with 11 additions and 68 deletions.
  1. +0 −33 Makefile
  2. +0 −17 header/license-header
  3. +0 −11 header/license-header.conf
  4. +1 −1 roguestar-engine.cabal
  5. +2 −1 src/Main.hs
  6. +8 −5 src/Protocol.hs
View
@@ -1,33 +0,0 @@
-HS_FLAGS = -hidir products/ \
- -odir products/ \
- -isrc/:products \
- -Wall \
- -fno-warn-type-defaults \
- --make src/Main.hs \
- -o products/roguestar-engine
-
-default : roguestar-engine
-
-update :
- darcs pull --all
-
-install :
- install products/roguestar-engine /usr/local/bin/
-
-clean :
- -rm -f products/*.o 2> /dev/null
- -rm -f products/*.hi 2> /dev/null
- -rm -f products/roguestar-engine 2> /dev/null
-
-roguestar-engine :
- @echo "warning: you're building with development flags on (-Werror, no optimization)"
- @echo " did you want to 'make release' ?"
- ghc-6.8.2 -Werror ${HS_FLAGS} -prof -auto-all
-
-release :
- ghc -O2 ${HS_FLAGS}
-
-dist:
- darcs dist
-
-.PHONY : default clean ghc ghc-release dist headache headache-remove release
View
@@ -1,17 +0,0 @@
-roguestar-engine: the space-adventure roleplaying game backend.
-Copyright (C) 2006 Christopher Lane Hinson <lane@downstairspeople.org>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
@@ -1,11 +0,0 @@
-# Objective Caml source
- ".*\\.ml[il]?" -> frame open:"(*" line:"*" close:"*)"
-| ".*\\.mly" -> frame open:"/*" line:"*" close:"*/"
-# C source
-| ".*\\.[ch]" -> frame open:"/*" line:"*" close:"*/"
-# Misc
-| ".*Makefile.*" -> frame open:"#" line:"#" close:"#"
-| ".*README.*" -> frame open:"*" line:"*" close:"*"
-| ".*LICENSE.*" -> frame open:"*" line:"*" close:"*"
-# Haskell Source
-| ".*\\.hs" -> frame open:"--" line:"-" close:""
@@ -1,5 +1,5 @@
name: roguestar-engine
-version: 0.2.1
+version: 0.2.2
license: OtherLicense
license-file: LICENSE
author: Christopher Lane Hinson
View
@@ -5,6 +5,7 @@ module Main (main)
import DB
import System.Environment
import System.Random
+import System.IO
import Data.List
import Tests
import HierarchicalDatabase
@@ -15,7 +16,7 @@ import Protocol
import GridRayCaster
roguestar_version_number :: String
-roguestar_version_number = "0.2.1"
+roguestar_version_number = "0.2.2"
roguestar_program_name :: String
roguestar_program_name = "roguestar-engine"
View
@@ -26,17 +26,20 @@ import ToolData
import Control.Monad.Error
import Numeric
import Turns
+import Data.IORef
-- Don't call dbBehave, use dbPerformPlayerTurn
import Behavior hiding (dbBehave)
-- We need to construct References based on UIDs, so we cheat a little:
import DBPrivate (Reference(..))
mainLoop :: DB_BaseType -> IO ()
-mainLoop db0 = do next_command <- getLine
- db1 <- ioDispatch (words $ map toLower next_command) db0
- putStrLn "over"
- hFlush stdout
- mainLoop db1
+mainLoop db0 =
+ do db <- newIORef db0
+ forever $
+ do next_command <- getLine
+ writeIORef db =<< ioDispatch (words $ map toLower next_command) =<< readIORef db
+ putStrLn "over"
+ hFlush stdout
done :: DB String
done = return "done"

0 comments on commit df9736d

Please sign in to comment.