|
@ -7,6 +7,7 @@ import qualified Data.ByteString.Lazy as BS |
|
|
import Data.Aeson |
|
|
import Data.Aeson |
|
|
import GHC.Generics |
|
|
import GHC.Generics |
|
|
import qualified Datatypes as DT |
|
|
import qualified Datatypes as DT |
|
|
|
|
|
import qualified Datatypes.Game as DT.Game |
|
|
import LCG |
|
|
import LCG |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -50,7 +51,7 @@ readInputInternal str = if isJust result |
|
|
newGame :: Input -> (Int,[(Int,DT.Game)]) |
|
|
newGame :: Input -> (Int,[(Int,DT.Game)]) |
|
|
newGame input = (JSONDeser.id input, zip (sourceSeeds input) (map gameFromSeed (sourceSeeds input))) |
|
|
newGame input = (JSONDeser.id input, zip (sourceSeeds input) (map gameFromSeed (sourceSeeds input))) |
|
|
where |
|
|
where |
|
|
gameFromSeed seed = DT.Game board (seedUnits seed input) (Set.empty :: Set.Set Int) 0 0 |
|
|
|
|
|
|
|
|
gameFromSeed seed = DT.Game.new board (seedUnits seed input) |
|
|
board = DT.Board w h filledel |
|
|
board = DT.Board w h filledel |
|
|
w = width input |
|
|
w = width input |
|
|
h = height input |
|
|
h = height input |
|
|