libspades
Ace of Spades library
grenade.h
1#ifndef LIBSPADES_GRENADE_H
2#define LIBSPADES_GRENADE_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include "datatypes.h"
8#include "map.h"
9
10struct Grenade {
11 Vector3Float position;
12 Vector3Float velocity;
13 uint64_t detonateTime;
14 uint8_t player;
20 uint8_t team;
21};
22
24 uint64_t lastUpdatedtime;
25 size_t usedItems;
27 struct Grenade *grenades;
28};
29
30int libspades_move_grenade(struct Grenade *grenade,
31 float secondsSinceLastUpdate,
32 const struct LibspadesMapData *mapData);
33
34bool libspades_create_grenade_array(struct GrenadeArray *array);
35void libspades_destroy_grenade_array(struct GrenadeArray *array);
36size_t libspades_add_grenade(struct Grenade *grenade, struct GrenadeArray *array);
37void libspades_remove_grenade(size_t index, struct GrenadeArray *array);
38
39#ifdef __cplusplus
40}
41#endif
42#endif
Definition grenade.h:23
struct Grenade * grenades
The actual array.
Definition grenade.h:27
uint64_t lastUpdatedtime
Using the standard clock, of course.
Definition grenade.h:24
size_t usedItems
The amount of grenades currently in the array.
Definition grenade.h:25
size_t allocatedItems
The amount of space currently allocated for grenades in the array.
Definition grenade.h:26
Definition grenade.h:10
uint8_t player
The player who threw the grenade.
Definition grenade.h:14
uint64_t detonateTime
The time at which the grenade should detonate.
Definition grenade.h:13
uint8_t team
Used to prevent screwing people over with team-changing, really.
Definition grenade.h:20
Definition map.h:15