Advertisement
Gabriel_Rofl

Untitled

Nov 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #ifndef __GOT_H__
  2. #define __GOT_H__
  3.  
  4.  
  5. /*-----------------------AS ESTRUTURAS-----------------------*/
  6.  
  7. typedef struct { /*Estrutura do personagen*/
  8.  
  9.     char* name;
  10.  
  11.     char* house;
  12.  
  13.     int agility;
  14.  
  15.     int strength;
  16.  
  17.     int intelligence;
  18.  
  19.     int health;
  20.  
  21. } Character;
  22.  
  23.  
  24. typedef struct node { /*nos sao representados por essa estrutura */
  25.  
  26.     Character* character;
  27.  
  28.     struct node* left;
  29.  
  30.     struct node* right;
  31.    
  32. }t_node;
  33.  
  34.  
  35. typedef struct { /*ponteiro pra raiz*/
  36.  
  37.     t_node* raiz;
  38.  
  39. }root;
  40.  
  41. typedef struct list_ptr{ /*elemento da lista duplamente encadeada */
  42.  
  43.     Character* character;
  44.  
  45.     struct list_ptr* anterior;
  46.  
  47.     struct list_ptr* proximo;
  48.  
  49. }element;
  50.  
  51.  
  52. typedef struct { /*ptr para o inicio e o fim da fila */
  53.  
  54.     element* begin;
  55.  
  56.     element* end;
  57.  
  58. }lista;
  59.  
  60. /* -----------------------AS FUNÇÕES-----------------------*/
  61.  
  62. t_node* node_create();
  63. t_node* tree_create();
  64. Character* character_create(char* _name, char* _house, int _agility, int _strength, int _intelligence, int _health);
  65. void inserir_character(Character* character, lista* l);
  66. lista* aloca_lista();
  67.  
  68.  
  69.  
  70.  
  71.  
  72. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement