![]() |
Starship Code Contest
0.1
A real student nightmare...
|
Haeder file for the acquisition functionalities. More...
Go to the source code of this file.
Data Structures | |
| struct | Decision_frame |
| This structure gathers the information needed to pilot a starship each frame. More... | |
| struct | View_starship |
| This structure gathers information scaned by the radar about other starships. More... | |
| struct | View_missile |
| This structure gathers information scaned by the radar about missiles. More... | |
Typedefs | |
| typedef void(* | AI) (Decision_frame *f) |
Functions | |
| double | get_x (char *me) |
| Get the position in absicca of the starship piloted by the plugin me. More... | |
| double | get_y (char *me) |
| Get the position in ordinate of the starship piloted by the plugin me. More... | |
| int | get_life (char *me) |
| Get the life of the starship piloted by the plugin me. More... | |
| int | get_speed (char *me) |
| Get the gear of the starship piloted by the plugin me. More... | |
| int | get_nb_team (char *me) |
| Get the number of the team of the starship piloted by the plugin me. More... | |
| int | get_gun_status (char *me) |
| Get the number of frames needed to reload the gun of the starship piloted by the plugin me. More... | |
| double | get_move_angle (char *me) |
| Get the moving angle of the starship piloted by the plugin me. More... | |
| double | get_gun_angle (char *me) |
| Get the angle of the gun of the starship piloted by the plugin me. More... | |
| double | get_radar_angle (char *me) |
| Get the angle of the radar of the starship piloted by the plugin me. More... | |
| void | get_scan_from_radar (char *me, View_starship **S, int *nb_starship, View_missile **M, int *nb_missile) |
| Set information that the radar can get in its current position. More... | |
Haeder file for the acquisition functionalities.
Definition in file acquisition.h.
| double get_gun_angle | ( | char * | me | ) |
Get the angle of the gun of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a double which is the angle of the gun of the starship in radian. When you are facing to your screen as the pixel up left is of coordinates (0,0), an angle 0 radian indicates the left, PI/2 indicate the down direction. The trigonometric circle thus turn clockwise (Be aware!!!!).
| int get_gun_status | ( | char * | me | ) |
Get the number of frames needed to reload the gun of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a integer which is the number of frames needed to reload the gun of the starship.
Referenced by decision_frame().
| int get_life | ( | char * | me | ) |
Get the life of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a integer which is the number of hits that the starship can handle before exploding. By default, starships have ten life points at the beginning of the fight.
| double get_move_angle | ( | char * | me | ) |
Get the moving angle of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a double which is the moving angle of the starship in radian. When you are facing to your screen as the pixel up left is of coordinates (0,0), an angle 0 radian indicates the left, PI/2 indicate the down direction. The trigonometric circle thus turn clockwise (Be aware!!!!).
| int get_nb_team | ( | char * | me | ) |
Get the number of the team of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a integer which is the internal number of the team of the starship. The graphical interface displays team number between 1 and n when internally, team number goes from 0 to n-1.
| double get_radar_angle | ( | char * | me | ) |
Get the angle of the radar of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a double which is the angle of the radar of the starship in radian. When you are facing to your screen as the pixel up left is of coordinates (0,0), an angle 0 radian indicates the left, PI/2 indicate the down direction. The trigonometric circle thus turn clockwise (Be aware!!!!).
| void get_scan_from_radar | ( | char * | me, |
| View_starship ** | S, | ||
| int * | nb_starship, | ||
| View_missile ** | M, | ||
| int * | nb_missile | ||
| ) |
Set information that the radar can get in its current position.
| me | a plugin name. |
| S | a pointer to an address of array of View_starship, thus of type View_starship** |
| nb_starship | a pointer to an integer. |
| M | a pointer to an address of array of View_missile, thus of type View_missile** |
| nb_missile | : a pointer to an integer. |
This function collect all elements that your radar can see... Visible starship will be placed in an array at address *S and will contains *nb_starship elements. It does the same for missiles. The function does the allocation and liberation of memory for you.
| int get_speed | ( | char * | me | ) |
Get the gear of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a integer which is the gear of the starship. If the starship doesn't move, it returns 0 for the neutral gear, 1 for the front gear and -1 for the reverse gear.
| double get_x | ( | char * | me | ) |
Get the position in absicca of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a double between 0.0 and 10.0 corresponding the position in absicca of the starship piloted by the plugin me. Some side effect can happen : sometimes and only during one or two frames, the absicca can crosses the bounds during collision resolution.
| double get_y | ( | char * | me | ) |
Get the position in ordinate of the starship piloted by the plugin me.
| me | : a plugin name |
The function returns a double between 0.0 and 10.0 corresponding the position in ordinate of the starship piloted by the plugin me. Some side effect can happen : sometimes and only during one or two frames, the ordinate can crosses the bounds during collision resolution.
1.8.13