naev 0.11.5
gatherable.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "commodity.h"
7#include "pilot.h"
8
14typedef struct Gatherable_ {
15 const Commodity *type;
18 double timer;
19 double lifeleng;
21 int sx;
22 int sy;
25
26/*
27 * Init/cleanup.
28 */
29int gatherable_load (void);
30void gatherable_cleanup (void);
31
32/*
33 * Gatherable objects
34 */
35int gatherable_init( const Commodity* com, const vec2 *pos, const vec2 *vel, double lifeleng, int qtt, unsigned int player_only );
36void gatherable_render( void );
37int gatherable_getClosest( const vec2 *pos, double rad );
38int gatherable_getPos( vec2* pos, vec2* vel, int id );
39void gatherable_free( void );
40void gatherable_update( double dt );
int gatherable_getPos(vec2 *pos, vec2 *vel, int id)
Returns the position and velocity of a gatherable.
Definition gatherable.c:189
void gatherable_free(void)
Frees all the gatherables.
Definition gatherable.c:142
int gatherable_init(const Commodity *com, const vec2 *pos, const vec2 *vel, double lifeleng, int qtt, unsigned int player_only)
Initializes a gatherable object.
Definition gatherable.c:66
int gatherable_getClosest(const vec2 *pos, double rad)
Gets the closest gatherable from a given position, within a given radius.
Definition gatherable.c:165
int gatherable_load(void)
Loads the gatherable system.
Definition gatherable.c:39
void gatherable_cleanup(void)
Cleans up after the gatherable system.
Definition gatherable.c:49
void gatherable_update(double dt)
Updates all gatherable objects.
Definition gatherable.c:92
void gatherable_render(void)
Renders all the gatherables.
Definition gatherable.c:150
Represents a commodity.
Definition commodity.h:43
Represents stuff that can be gathered.
Definition gatherable.h:14
int player_only
Definition gatherable.h:23
double lifeleng
Definition gatherable.h:19
double timer
Definition gatherable.h:18
const Commodity * type
Definition gatherable.h:15
Represents a 2d vector.
Definition vec2.h:32