Skip to content

Instantly share code, notes, and snippets.

@Orpheon
Created July 4, 2013 08:53
Show Gist options
  • Select an option

  • Save Orpheon/5926070 to your computer and use it in GitHub Desktop.

Select an option

Save Orpheon/5926070 to your computer and use it in GitHub Desktop.
#ifndef DATA_TYPES_H_INCLUDED
#define DATA_TYPES_H_INCLUDED
#include <stdbool.h>
typedef struct Bitmask;
typedef struct Point;
typedef struct Rect;
typedef struct RectLinkedList;
typedef struct Navmesh;
typedef struct Character;
struct Bitmask
{
int width;
int height;
bool **mask;
};
struct Point
{
int x;
int y;
};
struct Rect
{
Point topleft;
Point topright;
Point bottomleft;
Point bottomright;
Rect **connections;
int num_connections;
};
struct RectLinkedList
{
RectLinkedList *next;
Rect *rect;
};
struct Navmesh
{
int num_rects;
RectLinkedList *list;
};
struct Character
{
double x;
double y;
double hs;
double vs;
double width;
double height;
double speed;
};
#endif // DATA_TYPES_H_INCLUDED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment