object.h 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * File: object.h
  3. * Author: Arthur Brandao
  4. *
  5. * Created on 7 décembre 2018
  6. */
  7. #ifndef OBJECT_H
  8. #define OBJECT_H
  9. /* --- Include --- */
  10. #include "constante.h"
  11. /* --- Constante --- */
  12. #define OBJ_BCLASSIC 0
  13. #define OBJ_BMINE 1
  14. #define OBJ_BREMOTE 2
  15. #define OBJ_BOMBUP 3
  16. #define OBJ_BOMBDOWN 4
  17. #define OBJ_FIREPOWER 5
  18. #define OBJ_SCOOTER 6
  19. #define OBJ_BROKENLEG 7
  20. #define OBJ_LIFEUP 8
  21. #define OBJ_LIFEMAX 9
  22. #define OBJ_MAJOR 10
  23. /* --- Structure --- */
  24. typedef struct obj_node obj_node;
  25. struct obj_node{
  26. int type;
  27. int x;
  28. int y;
  29. obj_node* prev;
  30. obj_node* next;
  31. };
  32. typedef struct{
  33. obj_node* first;
  34. obj_node* last;
  35. int size;
  36. }Object;
  37. /* --- Fonctions --- */
  38. void object_ini(Object*);
  39. obj_node* object_add(Object*, int, int, int);
  40. obj_node* object_search(Object*, int, int, int);
  41. void object_delete(Object*, obj_node*);
  42. void object_clean(Object*);
  43. #endif /* OBJECT_H */