box.h 604 Bytes
Newer Older
Cassio Kirch's avatar
Cassio Kirch committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdbool.h>

#ifndef BOX_STRUCT
struct Box
{
  unsigned int boxID;
  struct Boid* first;
  struct Boid* last;
};
#define BOX_STRUCT
#endif

void initializeBoxes (struct Box* const box);

void appendBoid (struct Boid* boid, struct Box* const box);

void removeBoid (struct Boid* boid, struct Box* const box);

unsigned int getSouthBoxID (const unsigned int centralBoxID);

unsigned int getNorthBoxID (const unsigned int centralBoxID);

unsigned int getWestBoxID (const unsigned int centralBoxID);

unsigned int getEastBoxID (const unsigned int centralBoxID);

bool isInEdge (unsigned int boxID);