Advertisement
Gabriel_Rofl

got.h

Nov 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.23 KB | None | 0 0
  1. #ifndef __GOT_H__
  2. #define __GOT_H__
  3.  
  4.  
  5. /*-----------------------AS ESTRUTURAS-----------------------*/
  6.  
  7. typedef struct { /*Estrutura do personagem*/
  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.     //int pos;
  33.    
  34. }t_node;
  35.  
  36. typedef struct list_ptr{ /*elemento da lista duplamente encadeada */
  37.                    
  38.     Character* character;
  39.  
  40.     struct list_ptr* anterior;
  41.  
  42.     struct list_ptr* proximo;
  43.  
  44. }element;
  45.  
  46.  
  47. typedef struct { /*ptr para o inicio e o fim da fila */
  48.  
  49.     element* begin;
  50.  
  51.     element* end;
  52.  
  53. }lista;
  54.  
  55. /* -----------------------AS FUNÇÕES-----------------------*/
  56.  
  57. t_node* node_create();
  58.  
  59. t_node* tree_create();
  60.  
  61. Character* character_create(char* _name, char* _house, int _agility, int _strength, int _intelligence, int _health);
  62.  
  63. void inserir_character(Character* character, lista* l);
  64.  
  65. lista* aloca_lista();
  66.  
  67. int tree_formula();
  68.  
  69. t_node* tree_node(t_node* raiz);
  70.  
  71. int height(t_node* h);
  72.  
  73. int display();
  74.  
  75. void print_list(lista* l);
  76.  
  77.  
  78. element* aloca_element(Character* character);
  79.  
  80. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement