CengBall: API (documented for version: v0.5)

Pitch Class

Method name Parameters Return Description
Pitch none constructor This class represents the pitch the match is played on. Default constructor for the Pitch class. Dimensions are of Santiago Bernabeu. (108,72)
Pitch int, int, int, int constructor Constructor for the Pitch class. Parameters are: width of the field, height of the field, id of the goal at the left side of the field, id of the goal at the right side of the field.
calculateRatio int, int double Calculates the ratio that the pitch extents should be multiplied to fit the screen. Parameters are: the width of the window, the height of the window.
clone none Pitch Creates a copy of the pitch object and returns it.
contains vector2D boolean Checks if an object is with in the boundaries of the field. Parameter is position.
getBounds none Double Gets the boundaries of the field.
getGoalPost int Double Gets the goal post of the team with the given team ID.
getHalfCourt int Double Gets the half court of the team with the given team ID.
getKickOffPosition int vector2D Gets the kickoff position of a team.
getOtherGoalPost int Double Gets the goal post of the opponent team. Parameter is team ID of the own team.
getPitch none Double Gets the dimensions of the pitch.
getPitchHeight none double Gets the heigth of the field.
getPitchWidth none double Gets the width of the pitch.
isScored MovingObject, int boolean Checks if a team scored.
setGoalPostIDs int, int void Sets ids of the goal posts.

Attribute type Attribute name Description
double DEFAULT_RADIUS
double DEFAULT_CORNER_RADIUS
double DEFAULT_DOT_RADIUS
double DEFAULT_POST_HEIGHT
double DEFAULT_POST_HEIGHT
double DEFAULT_GOAL_AREA_LINE_WIDTH
double DEFAULT_GOAL_AREA_LINE_HEIGHT
double DEFAULT_PENALTY_AREA_WIDTH
double DEFAULT_PENALTY_AREA_HEIGHT
double DEFAULT_DOT_DISTANCE
double DEFAULT_PLAYER_RADIUS
double DEFAULT_BALL_RADIUS
double DEFAULT_VIEW_ANGLE
double DEFAULT_FRICTION
double DEFAULT_PATTERN_LINE_COUNT

TODO

News from CengBall

Quick Tutorial

How to set jdk path
How to import code

Twitter

    Follow @cengball

    © Copyright - Project 11