--- /dev/null
+implementation module Team_Opponent_Keeper_Assignment\r
+\r
+import Team\r
+from KeeperChallenger import keeperChallenger\r
+\r
+Team_Opponent_Keeper :: !Home FootballField -> Team\r
+Team_Opponent_Keeper home field\r
+ = getFielders club home field\r
+where\r
+ club = base_TeamName_Opponent_Keeper +++ if (home==West) "_W" "_E"\r
+\r
+base_TeamName_Opponent_Keeper :: String\r
+base_TeamName_Opponent_Keeper = "Opp_Keeper"\r
+\r
+getFielders :: String Home FootballField -> [Footballer]\r
+getFielders club home field\r
+ # chal1 = {keeperChallenger {clubName=club,playerNr=2} & pos = {px=west_edge + scale 0.025 field.flength,py=scale 0.20 field.fwidth}\r
+ , speed = {(keeperChallenger {clubName=club,playerNr=2}).speed & direction = rad (1.4*pi)}\r
+ }\r
+ # chal2 = {keeperChallenger {clubName=club,playerNr=3} & pos = {px=west_edge + scale 0.060 field.flength,py=scale 0.15 field.fwidth}}\r
+ # chal3 = {keeperChallenger {clubName=club,playerNr=4} & pos = {px=west_edge + scale 0.080 field.flength,py=scale 0.00 field.fwidth}\r
+ , speed = {(keeperChallenger {clubName=club,playerNr=4}).speed & direction = rad (0.0*pi)}\r
+ }\r
+ # chal4 = {keeperChallenger {clubName=club,playerNr=5} & pos = {px=west_edge + scale 0.060 field.flength,py=scale -0.15 field.fwidth}}\r
+ # chal5 = {keeperChallenger {clubName=club,playerNr=6} & pos = {px=west_edge + scale 0.025 field.flength,py=scale -0.20 field.fwidth}\r
+ , speed = {(keeperChallenger {clubName=club,playerNr=6}).speed & direction = rad (0.6*pi)}\r
+ }\r
+ # fielders = [chal1,chal2,chal3,chal4,chal5]\r
+ # fielders = map (mirrorDirection home) fielders\r
+ | home == East = fielders\r
+ | otherwise = mirror field fielders\r
+where\r
+ west_edge = scale -0.5 field.flength\r
+ \r
+mirrorDirection :: !Home !Footballer -> Footballer\r
+mirrorDirection home fielder\r
+ = {fielder & speed = {fielder.speed & direction = if (d > rad pi) (d - rad pi) (d + rad pi)}}\r
+where\r
+ d = fielder.speed.direction\r