Burp
Data Structures | Functions
missile.c File Reference
#include "missile.h"
Include dependency graph for missile.c:

Data Structures

struct  missile_impl
 

Functions

missilecreate_missile (double pos_x, double pos_y, double angle, robot *rob, double explo_dist)
 
void update_pos_missile (missile *m)
 
bool will_explode (missile *m)
 
bool explode (missile *mis, point *explode_point)
 
void collision_with_missiles (robot *rob, missile *m)
 
double get_missile_angle (missile *m)
 
double get_missile_speed (missile *m)
 
void get_missile_pos (missile *m, point *p)
 
double get_parcouru_distant (missile *m)
 
robotget_missile_owner (missile *m)
 
double get_explosion_distant (missile *m)
 
bool destroy_missile (missile **m)
 

Function Documentation

◆ collision_with_missiles()

void collision_with_missiles ( robot rob,
missile m 
)

Check if the missile [m] has a collision with the robot [rob]. if there is one, it'll set [will_explode] to true else it'll do nothing.

Here is the call graph for this function:

◆ create_missile()

missile* create_missile ( double  pos_x,
double  pos_y,
double  angle,
robot rob,
double  explo_dist 
)

Allocate a missile in memory and assign [pos_x] and [pos_y] as its coordinate, [angle] as the angle trajectory, [rob] as the owner of the missle and [explo_dist] as the distance limit the missile can navigate before exploding. The speed value is equal to [MISSILE_SPEED]

Here is the call graph for this function:

◆ destroy_missile()

bool destroy_missile ( missile **  m)

Free a missile allocated in memory.

Here is the call graph for this function:

◆ explode()

bool explode ( missile mis,
point explode_point 
)

If the missile is ready to explode, it'll set [explode_point] to the value of the missile at the moment of the explosion and return true. If he isn't ready to explode, it'll return false

◆ get_explosion_distant()

double get_explosion_distant ( missile m)

Return the explosion distance of the missile [m].

◆ get_missile_angle()

double get_missile_angle ( missile m)

Return the angle of the missile [m].

◆ get_missile_owner()

robot* get_missile_owner ( missile m)

return a pointer to the owner of the missile [m].

◆ get_missile_pos()

void get_missile_pos ( missile m,
point p 
)

Put the coordinate as a point of a missile [m] into a point [p].

◆ get_missile_speed()

double get_missile_speed ( missile m)

Return the speed of the missile [m].

◆ get_parcouru_distant()

double get_parcouru_distant ( missile m)

Return the travelled distance of the missile [m].

◆ update_pos_missile()

void update_pos_missile ( missile m)

Update the missile is position and will also check if the missile will explode this turn which include : hitting a wall and going over [explo_dist].

Here is the call graph for this function:

◆ will_explode()

bool will_explode ( missile m)

Return true if the missile [m] is ready to explode, false otherwise.