object.h 538 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef OBJECT_H_
  2. #define OBJECT_H_
  3. #include <graphx.h>
  4. #include "sprite.h"
  5. typedef struct Scale {
  6. int x;
  7. int y;
  8. } Scale;
  9. typedef struct Object Object;
  10. struct Object {
  11. int id;
  12. int x;
  13. int y;
  14. Scale scale;
  15. Sprite* sprite;
  16. void* data;
  17. size_t data_size;
  18. int (*height)(Object*);
  19. int (*width)(Object*);
  20. void (*draw)(Object*);
  21. void (*update)(Object*);
  22. void (*load)(Object*);
  23. };
  24. void Object_draw(Object* self);
  25. void free_Object(Object* self);
  26. Object* new_Object(int x, int y);
  27. #endif