packages feed

SoccerFunGL-0.4.2: SoccerFun/UI/GL/RunMatch.hs

{-# LANGUAGE UnicodeSyntax #-}
-- | Usage: Hit /q/ to abort the match
module Main where

import SoccerFun.UI.GL
import Control.Monad
import System.Exit
import Prelude.Unicode
import Data.Binary
import SoccerFun.MatchGame
import SoccerFun.Tape

main ∷ IO ()
main = do
	(prog,args) ← initialise
	let (t1,t2) = case args of
		[t1,t2] → (t1,t2)
		notTwo → error $ unlines
			["Run a match between two teams <Team1> and <Team2>",
			 "Usage: " ⧺ prog ⧺ " <dir1> <dir2>",
			 "  where both arguments are paths to directories containing a team module."]
	(t1name,t2name,match) ← dynSetupMatch t1 t2
	playTape $ recordMatch match