![]() |
naev 0.10.4
|
Handles gatherable objects. More...
Go to the source code of this file.
Macros | |
| #define | GATHER_DIST 30. |
Functions | |
| int | gatherable_load (void) |
| void | gatherable_cleanup (void) |
| int | gatherable_init (const Commodity *com, vec2 pos, vec2 vel, double lifeleng, int qtt, unsigned int player_only) |
| Initializes a gatherable object. More... | |
| void | gatherable_update (double dt) |
| Updates all gatherable objects. More... | |
| void | gatherable_free (void) |
| Frees all the gatherables. More... | |
| void | gatherable_render (void) |
| Renders all the gatherables. More... | |
| int | gatherable_getClosest (vec2 pos, double rad) |
| Gets the closest gatherable from a given position, within a given radius. More... | |
| int | gatherable_getPos (vec2 *pos, vec2 *vel, int id) |
| Returns the position and velocity of a gatherable. More... | |
| void | gatherable_gather (Pilot *p) |
| See if the pilot can gather anything. More... | |
Variables | |
| static Gatherable * | gatherable_stack = NULL |
| static float | noscoop_timer = 1. |
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 | ) |
Definition at line 36 of file gatherable.c.
| void gatherable_free | ( | void | ) |
Frees all the gatherables.
Definition at line 99 of file gatherable.c.
| void gatherable_gather | ( | Pilot * | p | ) |
See if the pilot can gather anything.
| p | Pilot to try to gather for. |
Definition at line 168 of file gatherable.c.
| int gatherable_getClosest | ( | vec2 | pos, |
| double | rad | ||
| ) |
Gets the closest gatherable from a given position, within a given radius.
| pos | position. |
| rad | radius. |
Definition at line 122 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 146 of file gatherable.c.
| int gatherable_init | ( | const Commodity * | com, |
| vec2 | pos, | ||
| 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 52 of file gatherable.c.
| int gatherable_load | ( | void | ) |
Definition at line 30 of file gatherable.c.
| void gatherable_render | ( | void | ) |
Renders all the gatherables.
Definition at line 107 of file gatherable.c.
| void gatherable_update | ( | double | dt | ) |
Updates all gatherable objects.
| dt | Elapsed time. |
Definition at line 77 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 28 of file gatherable.c.