1 definition module Referee
3 /** The referee data type, and all available referees within Soccer-Fun.
5 import Footballer, GamePicture, matchGame
9 , brain :: !Brain (RefereeAI RefereeOutput (memory,RandomSeed)) memory
10 , refActionPics :: ![Path]
12 :: RefereeAI msg memory :== (RefereeInput,memory) -> (msg,memory)
13 :: RefereeAI` msg :== RefereeInput -> msg
14 :: RefereeInput = { playingTime :: !PlayingTime // the duration of an entire match
15 , unittime :: !TimeUnit // the time unit of a single simulation step
16 , theBall :: !FootballState // the whereabouts of the football
17 , playingHalf :: !Half // first or second half; team1 is team that starts game on West; team2 is other team
18 , team1 :: !Team // team1
19 , team2 :: !Team // team2
20 , lastContact :: !Maybe FootballerID // last player who has played the ball
22 :: RefereeOutput :== [RefereeAction]
24 instance nameOf Referee
26 defaultReferee :: Referee
28 allAvailableReferees:: [FootballField -> Referee]
29 defaultImage :: !Match !RefereeAction !*env -> (!Bitmap,!*env) | FileSystem env
30 defaultSoundFile :: !RefereeAction -> Maybe String
32 /** Wrapper functions for simpler referee brains:
34 randomlessRefereeAI :: (RefereeAI msg memory) -> RefereeAI msg (memory,RandomSeed)
35 amnesiaRefereeAI :: (RefereeAI msg RandomSeed) -> RefereeAI msg (memory,RandomSeed)
36 witlessRefereeAI :: (RefereeAI` msg) -> RefereeAI msg (memory,RandomSeed)