![]() |
naev 0.12.6
|
Handles gatherable objects. More...

Go to the source code of this file.
Macros | |
| #define | GATHER_DIST 30. |
Functions | |
| static int | gatherable_gather (Gatherable *gat, Pilot *p) |
| See if the pilot can gather anything. | |
| int | gatherable_load (void) |
| Loads the gatherable system. | |
| void | gatherable_cleanup (void) |
| Cleans up after the gatherable system. | |
| int | gatherable_init (const Commodity *com, const vec2 *pos, const vec2 *vel, double lifeleng, int qtt, unsigned int player_only) |
| Initializes a gatherable object. | |
| void | gatherable_update (double dt) |
| Updates all gatherable objects. | |
| void | gatherable_free (void) |
| Frees all the gatherables. | |
| void | gatherable_render (void) |
| Renders all the gatherables. | |
| int | gatherable_getClosest (const vec2 *pos, double rad) |
| Gets the closest gatherable from a given position, within a given radius. | |
| int | gatherable_getPos (vec2 *pos, vec2 *vel, int id) |
| Returns the position and velocity of a gatherable. | |
Variables | |
| static Gatherable * | gatherable_stack |
| static float | noscoop_timer = 1. |
| static IntList | gather_qtquery |
Handles gatherable objects.
Definition in file gatherable.c.
| #define GATHER_DIST 30. |
Maximum distance a gatherable can be gathered.
Definition at line 24 of file gatherable.c.
| void gatherable_cleanup | ( | void | ) |
Cleans up after the gatherable system.
Definition at line 50 of file gatherable.c.
| void gatherable_free | ( | void | ) |
Frees all the gatherables.
Definition at line 147 of file gatherable.c.
|
static |
See if the pilot can gather anything.
| gat | Gatherable to try to gather. |
| p | Pilot to try to gather for. |
Definition at line 220 of file gatherable.c.
| int gatherable_getClosest | ( | const vec2 * | pos, |
| double | rad ) |
Gets the closest gatherable from a given position, within a given radius.
| pos | position. |
| rad | radius. |
Definition at line 173 of file gatherable.c.
Returns the position and velocity of a gatherable.
| pos | pointer to the position. |
| vel | pointer to the velocity. |
| id | Id of the gatherable in the stack. |
Definition at line 197 of file gatherable.c.
| int gatherable_init | ( | const Commodity * | com, |
| const vec2 * | pos, | ||
| const vec2 * | vel, | ||
| double | lifeleng, | ||
| int | qtt, | ||
| unsigned int | player_only ) |
Initializes a gatherable object.
| com | Type of commodity. |
| pos | Position. |
| vel | Velocity. |
| lifeleng | Duration in seconds. |
| qtt | Quantity to add. |
| player_only | Whether the gatherable can only be gathered by the player. |
Definition at line 68 of file gatherable.c.
| int gatherable_load | ( | void | ) |
| void gatherable_render | ( | void | ) |
Renders all the gatherables.
Definition at line 156 of file gatherable.c.
| void gatherable_update | ( | double | dt | ) |
Updates all gatherable objects.
| dt | Elapsed time. |
Definition at line 95 of file gatherable.c.
|
static |
For collisions.
Definition at line 30 of file gatherable.c.
|
static |
Contains the gatherable stuff floating around.
Definition at line 27 of file gatherable.c.
|
static |
Timer for the "full cargo" message .
Definition at line 29 of file gatherable.c.