made some changes
This commit is contained in:
parent
695f9e79a0
commit
7d4ff9021e
4
main.c
4
main.c
@ -93,6 +93,10 @@ int getNear(int dir){
|
||||
return map[coord.x][coord.y].type;
|
||||
}
|
||||
|
||||
int getInventory(){
|
||||
return current_dude->inventory;
|
||||
}
|
||||
|
||||
void spawnDudes(){
|
||||
int i;
|
||||
t_dude new_dude;
|
||||
|
2
orange.c
2
orange.c
@ -7,7 +7,7 @@ typedef struct{
|
||||
int plop; // custom info
|
||||
} t_data;
|
||||
|
||||
t_action orange_update(void* my_info, void* com_data, int success){
|
||||
t_action orange_update(void* my_info, t_com* communication_data, int success){
|
||||
t_data* data = (t_data*)my_info;
|
||||
t_action action;
|
||||
|
||||
|
2
purple.c
2
purple.c
@ -40,7 +40,7 @@ int dist(t_coord coord, int x, int y){
|
||||
return abs(coord.x-x) + abs(coord.y-y);
|
||||
}
|
||||
|
||||
t_action purple_update(void* my_info, void* com_data, int success){
|
||||
t_action purple_update(void* my_info, t_com* com_data, int success){
|
||||
t_data* data = (t_data*)my_info;
|
||||
t_action action;
|
||||
int i, type;
|
||||
|
43
team.h
43
team.h
@ -1,14 +1,35 @@
|
||||
#ifndef TEAM_H
|
||||
#define TEAM_H
|
||||
|
||||
#define LIBRARY_SIZE 128
|
||||
#define DUDE_MEMORY 128
|
||||
#define WRITE 0
|
||||
#define READ 4
|
||||
|
||||
// coordinates structure
|
||||
typedef struct{
|
||||
int x;
|
||||
int y;
|
||||
} t_coord;
|
||||
|
||||
// Directions
|
||||
enum{
|
||||
NORTH, SOUTH, EAST, WEST
|
||||
};
|
||||
|
||||
// communication
|
||||
#define LIBRARY_SIZE 128
|
||||
#define DUDE_MEMORY 128
|
||||
enum{
|
||||
BOOK_1,
|
||||
BOOK_2,
|
||||
BOOK_3,
|
||||
BOOK_4
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
int flag;
|
||||
char data[32];
|
||||
} t_com;
|
||||
|
||||
// Tile types
|
||||
enum{
|
||||
BEDROCK, GRASS, TREE, BERRIES, ROCK, IRON_ORE, // nature
|
||||
@ -19,25 +40,21 @@ enum{
|
||||
|
||||
// Action types
|
||||
enum{
|
||||
MOVE, ATTACK, PICK, PUT, WORK, WAIT, COMMUNICATE
|
||||
MOVE,
|
||||
ATTACK,
|
||||
PICK,
|
||||
PUT,
|
||||
WORK,
|
||||
WAIT,
|
||||
COMMUNICATE
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
int x;
|
||||
int y;
|
||||
} t_coord;
|
||||
|
||||
typedef struct{
|
||||
int type;
|
||||
int dir;
|
||||
void* data;
|
||||
} t_action;
|
||||
|
||||
typedef struct{
|
||||
int dest;
|
||||
void* message;
|
||||
} t_communication;
|
||||
|
||||
int getInventory();
|
||||
|
||||
int getNear(int dir);
|
||||
|
Loading…
x
Reference in New Issue
Block a user