typedef struct hyperKaos HyperKaos;
typedef struct synergy Synergy;

typedef struct fgImage
{
  int frames;
  int frameNow;
  int dualLayer;

  SDL_Rect location;
  SDL_Surface* spriteSheet;
} FGImage;


typedef struct warpZone
{
  SDL_Rect location;
  enum dataChunks chunk;
  int destination;
  int x, y;
} WarpZone;

typedef struct room
{
  SDL_Surface* spriteSheet;
  SDL_Surface* bgImage;
  int frameNo;

  SDL_Rect* obstacle;
  int numberOfObstacles;
  int maxNumberOfObstacles;

  struct fgImage* fgObject;
  int numberOfObj;
  int maxNumberOfObj;
  int objSpeed;
  int objIterator;

  WarpZone* warps;
  int numberOfWarps;
  int maxNumberOfWarps;

  HyperKaos** eventTriggers;
  int numberOfTriggers;
  int maxNumberOfTriggers;

  Synergy** sigils;
  int numberOfSigils;
  int maxNumberOfSigils;

  Player** people;
  int numberOfPeople;
  int maxNumberOfPeople;

} Room;

void warpto(Room* destination);

Room* newRoom(char* filename, int a);
void deleteRoom(Room* target);

void changeRSprite(Room* self, SDL_Rect* clip);
void animate(Room* self);

int checkCollision(Room* self, Player* player, SDL_Rect* box);
int checkWCollision(Room* self, SDL_Rect* player, WarpZone* warpBoxes, int* whichWarp);
int checkKCollision(Room* self, SDL_Rect* player, HyperKaos** triggers, int* whichTrigger, int* triggerType);

void addObstacle(Room* self, int x, int y, int w, int h);
void deleteObstacle(Room* self, int i);

void addFgObj(Room* self, int x, int y, int w, int h, char* filename, int f, int dual, int alpha);
void deleteFgObj(Room* self, int i);
void drawFgObjects1(Room* self);
void drawFgObjects2(Room* self);

void addWarp(Room* self, int x, int y, int w, int h, enum dataChunks toChunk, int toRoom, int toX, int toY);
void deleteWarp(Room* self, int i);

void addTrigger(Room* self, HyperKaos* newTrigger);
void deleteTrigger(Room* self, int i);

void addSigil(Room* self, Synergy* newSigil);
void deleteSigil(Room* self, int i);

void addPerson(Room* self, Player* newPlayer);
void deletePerson(Room* self, int i);
void drawPeople(Room* self);
