initial framework added
[fp1415-soccerfun.git] / src / Game / Referee.dcl
1 definition module Referee
2
3 /** The referee data type, and all available referees within Soccer-Fun.
4 */
5 import Footballer, GamePicture, matchGame
6
7 :: Referee = E.memory:
8 { name :: !String
9 , brain :: !Brain (RefereeAI RefereeOutput (memory,RandomSeed)) memory
10 , refActionPics :: ![Path]
11 }
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
21 }
22 :: RefereeOutput :== [RefereeAction]
23
24 instance nameOf Referee
25
26 defaultReferee :: Referee
27
28 allAvailableReferees:: [FootballField -> Referee]
29 defaultImage :: !Match !RefereeAction !*env -> (!Bitmap,!*env) | FileSystem env
30 defaultSoundFile :: !RefereeAction -> Maybe String
31
32 /** Wrapper functions for simpler referee brains:
33 */
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)