Advertisement
Gabriel_Rofl

Untitled

Nov 17th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 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. }t_node;
  33.  
  34.  
  35. typedef struct list_ptr{ /*elemento da lista duplamente encadeada */
  36.                    
  37.     t_node* no;
  38.  
  39.     struct list_ptr* anterior;
  40.  
  41.     struct list_ptr* proximo;
  42.  
  43. }element;
  44.  
  45.  
  46. typedef struct { /*ptr para o inicio e o fim da fila */
  47.  
  48.     element* begin;
  49.  
  50.     element* end;
  51.  
  52. }lista;
  53.  
  54. /* -----------------------AS FUNÇÕES-----------------------*/
  55.  
  56. t_node* node_create();
  57. t_node* tree_create();
  58. Character* character_create(char* _name, char* _house, int _agility, int _strength, int _intelligence, int _health);
  59. void inserir_character(Character* character, lista* l);
  60. lista* aloca_lista();
  61.  
  62. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement