This module defines the part of the SoccerFun API that is concerned with the player data types.
- data Player = forall m . Player {}
- type PlayerAI memory = BrainInput -> State memory PlayerAction
- data BrainInput = BrainInput {}
- type PlayerWithAction = (PlayerAction, PlayerID)
- type PlayerWithEffect = (Maybe PlayerEffect, PlayerID)
- type MajorSkills = (Skill, Skill, Skill)
- data Skill
- data FeintDirection
- = FeintLeft
- | FeintRight
- data PlayerAction
- data PlayerEffect
- type Stamina = Float
- type Health = Float
- defaultPlayer :: PlayerID -> Player
- identifyPlayer :: PlayerID -> Player -> Bool
- playerIdentity :: Player -> PlayerID
- getBall :: BallState -> [Player] -> Ball
- ballGainedByKeeper :: BallState -> [Player] -> ClubName -> Home -> Field -> Bool
- clonePlayer :: Brain (PlayerAI m) m -> Player -> Player
- class SameClub a where
- class GetPosition a where
- getPosition :: a -> Position
- inRadiusOfPlayer :: Position -> Player -> Bool
- skillsAsList :: Player -> [Skill]
- isFirstHalf :: Half -> Bool
- isSecondHalf :: Half -> Bool
- getClubName :: Player -> ClubName
- isKeeper :: Player -> Bool
- isFielder :: Player -> Bool
- maxGainReach :: Player -> Metre
- maxJumpReach :: Player -> Metre
- maxGainVelocityDifference :: Player -> Metre -> Velocity
- maxCatchVelocityDifference :: Player -> Metre -> Velocity
- maxKickReach :: Player -> Metre
- maxHeadReach :: Player -> Metre
- maxCatchReach :: Player -> Metre
- maxTackleReach :: Player -> Metre
- maxVelocityBallKick :: Player -> Velocity
- maxVelocityBallHead :: Player -> Velocity -> Velocity
- maxKickingDeviation :: Player -> Angle
- maxHeadingDeviation :: Player -> Angle
- maxRotateAngle :: Player -> Angle
- maxFeintStep :: Player -> Metre
- type HealthStaminaFactor = Float
- getHealthStaminaFactor :: Health -> Stamina -> HealthStaminaFactor
- teamHome :: ATeam -> Half -> Home
- opponentHome :: ATeam -> Half -> Home
- isMove :: PlayerAction -> Bool
- isGainBall :: PlayerAction -> Bool
- isCatchBall :: PlayerAction -> Bool
- isKickBall :: PlayerAction -> Bool
- isHeadBall :: PlayerAction -> Bool
- isFeint :: PlayerAction -> Bool
- isPlayerTackle :: PlayerAction -> Bool
- isSchwalbe :: PlayerAction -> Bool
- isPlayTheater :: PlayerAction -> Bool
- isSkillOfAction :: Skill -> PlayerAction -> Bool
- isActionOnBall :: PlayerAction -> Bool
- isMoved :: PlayerEffect -> Bool
- isGainedBall :: PlayerEffect -> Bool
- isKickedBall :: PlayerEffect -> Bool
- isHeadedBall :: PlayerEffect -> Bool
- isFeinted :: PlayerEffect -> Bool
- isTackled :: PlayerEffect -> Bool
- isSchwalbed :: PlayerEffect -> Bool
- isCaughtBall :: PlayerEffect -> Bool
- isPlayedTheater :: PlayerEffect -> Bool
- isOnTheGround :: PlayerEffect -> Bool
- failPlayerAction :: PlayerAction -> PlayerEffect
Documentation
forall m . Player | |
|
type PlayerAI memory = BrainInput -> State memory PlayerActionSource
type PlayerWithAction = (PlayerAction, PlayerID)Source
type PlayerWithEffect = (Maybe PlayerEffect, PlayerID)Source
type MajorSkills = (Skill, Skill, Skill)Source
Running | Faster running without ball in possession |
Dribbling | Faster running with ball in possession |
Rotating | Wider range of rotation |
Gaining | Better ball gaining ability |
Kicking | More accurate and wider ball kicking |
Heading | More accurate and wider ball heading |
Feinting | Wider range of feint manouvre |
Jumping | Further jumping |
Catching | Better catching |
Tackling | More effective tackling |
Schwalbing | Better acting of tackles |
PlayingTheater | Better acting of playing theater |
data PlayerAction Source
actions a player can intend to perform
Move Speed Angle | wish to rotate over given angle, and then move with given speed |
Feint FeintDirection | wish to make feint manouvre |
KickBall Speed3D | wish to kick ball with given speed |
HeadBall Speed3D | wish to head ball with given speed |
GainBall | wish to gain possession of the ball from other player |
CatchBall | wish to catch the ball with his hands |
Tackle PlayerID Velocity | wish to tackle identified player, higher velocity is higher chance of succes AND injury (and foul?) |
Schwalbe | wish to fall as if he was tackled |
PlayTheater | wish to act as if he was hurt |
data PlayerEffect Source
Moved Speed Angle | player has rotated with given angle, and then ran with given speed |
Feinted FeintDirection | player had feinted |
KickedBall (Maybe Speed3D) | player kicked ball (Just v) with velocity, or didn't (Nothing) |
HeadedBall (Maybe Speed3D) | player headed ball (Just v) with velocity, or didn't (Nothing) |
GainedBall Success | player attempt to gain ball from other player |
CaughtBall Success | player caught the ball with his hands |
Tackled PlayerID Velocity Success | player attempt to tackle an opponent |
Schwalbed | player had performed a schwalbe |
PlayedTheater | player had started to act hurt |
OnTheGround FramesToGo | tackled by someone else; FramesToGo is the amount of frames that you will be on the ground |
identifyPlayer :: PlayerID -> Player -> BoolSource
getBall :: BallState -> [Player] -> BallSource
getBall returns the ball (containing its position and speed-information) | that is either free or gained by a player. | For this reason, the list of players must contain all players, otherwise | this function may fail.
ballGainedByKeeper :: BallState -> [Player] -> ClubName -> Home -> Field -> BoolSource
Returns True if the ball is held by a Keeper in his own penaltyarea | Returns False when the ball is held by a Keeper in open field | Returns False when the ball is not held by a Keeper | Keepers should be numbered with 1.
isFirstHalf :: Half -> BoolSource
isSecondHalf :: Half -> BoolSource
getClubName :: Player -> ClubNameSource
chest size of player
stomach size of player
maxGainReach :: Player -> MetreSource
minimum length of a person. Advantages: better gainball; better stamina at sprinting; better dribbling; less health damage when fall, better rotating.
maximum length of a person. Advantages: wider gainball; better stamina at running; higher headball; improved catching; harder kicking.
minimum height of a person. Advantages: better gainball; better stamina at sprinting; better dribbling; less health damage when fall, better rotating.
maximum height of a person. Advantages: wider gainball; better stamina at running; higher headball; improved catching; harder kicking.
Player attribute dependent abilities: use these functions to make your player correctly dependent of abilities.
maxJumpReach :: Player -> MetreSource
vertical jumping
maxKickReach :: Player -> MetreSource
maxHeadReach :: Player -> MetreSource
maxCatchReach :: Player -> MetreSource
includes horizontal jumping
maxTackleReach :: Player -> MetreSource
maxVelocityBallHead :: Player -> Velocity -> VelocitySource
maxRotateAngle :: Player -> AngleSource
maximum angle with which player can rotate
maxFeintStep :: Player -> MetreSource
maximum side step of player for feint manouvre
type HealthStaminaFactor = FloatSource
combination of stamina and health
opponentHome :: ATeam -> Half -> HomeSource
isMove :: PlayerAction -> BoolSource
isGainBall :: PlayerAction -> BoolSource
isKickBall :: PlayerAction -> BoolSource
isHeadBall :: PlayerAction -> BoolSource
isFeint :: PlayerAction -> BoolSource
isSchwalbe :: PlayerAction -> BoolSource
isSkillOfAction :: Skill -> PlayerAction -> BoolSource
isMoved :: PlayerEffect -> BoolSource
isFeinted :: PlayerEffect -> BoolSource
isTackled :: PlayerEffect -> BoolSource