SoccerFun 0.4 → 0.4.1
raw patch · 2 files changed
+13/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ SoccerFun.MatchGame: setupMatch :: (Home -> Field -> Team) -> (Home -> Field -> Team) -> IO Match
Files
- SoccerFun.cabal +1/−1
- SoccerFun/MatchGame.hs +12/−0
SoccerFun.cabal view
@@ -1,5 +1,5 @@ Name: SoccerFun-Version: 0.4+Version: 0.4.1 Copyright: (c) 2010, Jan Rochel License: BSD3 License-File: LICENSE
SoccerFun/MatchGame.hs view
@@ -5,8 +5,13 @@ import SoccerFun.Types import SoccerFun.Player import SoccerFun.MatchControl+import SoccerFun.Field+import SoccerFun.Team import SoccerFun.RefereeAction import SoccerFun.Prelude+import SoccerFun.Referee.Ivanov+import Control.Monad+import System.Random showTime ∷ Minutes → String -- ^ display time in (mm:ss min) format@@ -39,6 +44,13 @@ logRefereeAction (DisplacePlayers ds) = Just $ "DisplacePlayers" logRefereeAction ContinueGame = Nothing logRefereeAction (TellMessage txt) = Just $ "TellMessage " ++ show txt++setupMatch ∷ (Home → Field → Team) → (Home → Field → Team) → IO Match+setupMatch t1 t2 = let+ field = Field 70 105+ team1 = t1 West field+ team2 = t2 East field+ in liftM (setMatchStart team1 team2 field (ivanovReferee field team1 team2) 1) newStdGen {- This module defines the match and tournament data structures. -}