-
Notifications
You must be signed in to change notification settings - Fork 2
/
elemento.h
68 lines (57 loc) · 1.07 KB
/
elemento.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef ELEMENTO_H
#define ELEMENTO_H
#include <stdio.h>
#include <stdlib.h>
typedef enum{
False, True
} bool;
typedef char* string;
//union de atributo que pode se referir a um valor ou uma qualidade do objeto
typedef union{
int val;
string quali;
} atrib;
//lista de atributos do objeto
typedef struct{
atrib* lista;
} Objeto;
//lista de salas adjacentes a uma sala
typedef struct{
void* saidas[4];
} Lugar;
//union que determina se o elemento é objeto ou lugar
typedef union{
Objeto objeto;
Lugar lugar;
}detalhe;
//elo a ser usado em listas ligadas
typedef struct elo{
void* val;
char* nome;
int tipo;
struct elo* next;
} Elo;
//criação de uma lista ligada
typedef struct {
Elo * cabec ;
} Lista ;
//criação de uma hash table
typedef struct TabSim{
int size;
Lista* listas;
} TabSim;
//definindo nosso elemento
typedef struct Elemento{
string nome;
string* artigos;
string longa;
string curta;
bool ativo;
bool visivel;
bool conhecido;
TabSim conteudo;
int (**acoes)(struct Elemento*,struct Elemento*);
void* animacao;
detalhe def;
}Elemento;
#endif