This commit is contained in:
Lendemor 2015-01-19 08:06:50 +01:00
commit f61e4c63e4
2 changed files with 24 additions and 0 deletions

22
main.c
View File

@ -93,6 +93,28 @@ int getNear(int dir){
return map[coord.x][coord.y].type;
}
int getInfo(int dir){
t_coord coord = getPos(current_dude->pos, dir);
t_pixel pixel = map[coord.x][coord.y];
t_dude* dude;
int* n;
switch(pixel.type){
case DUDE :
dude = pixel.data;
return dude->team;
case FOOD :
case WOOD :
case STONE :
case IRON :
case SWORD :
case SPAWN :
n = pixel.data;
return *n;
default :
return -1;
}
}
int getInventory(){
return current_dude->inventory;
}

2
team.h
View File

@ -59,4 +59,6 @@ int getInventory();
int getNear(int dir);
int getInfo(int dir);
#endif