Browse Source

deleted inizialization bug in JSONDeser.readInput

adaptedStrategy0
Andrea Bellandi 9 years ago
parent
commit
a9843e59f2
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      src/Datatypes/Game.hs
  2. +2
    -1
      src/JSONDeser.hs

+ 1
- 1
src/Datatypes/Game.hs View File

@ -1,4 +1,4 @@
module Datatypes.Game (Game(..), completed) where
module Datatypes.Game (Game(..), completed, new) where
import Data.Hashable (hash) import Data.Hashable (hash)
import Data.Set (Set) import Data.Set (Set)


+ 2
- 1
src/JSONDeser.hs View File

@ -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


Loading…
Cancel
Save