12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /*
- Copyright (C) 2011 Weber Yann, Schuck Clement
-
- This file is part of Tansive.
-
- Tansive is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Tansive is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Tansive. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef MAP_H
- #define MAP_H
-
- #include<pthread.h>
-
- #include"creature.h"
-
- /*
- Map.h :
- Defines struct and functions for map's management
- */
-
- #define MAP_ELT_EMPTY 0
- #define MAP_ELT_VEGET 1
- #define MAP_ELT_CREAT 2
-
- #define MAP_VEG_REGEN 1500
- #define MAP_VEG_SPAWN 8000
- #define MAP_VEG_COEFPROX 99
- #define MAP_VEG_MIN_TIMELEFT 1
- #define MAP_VEG_MAX_TIMELEFT 50
-
- //Store one element of the map
- typedef struct _t_map_element
- {
- char type; //Take values in MAP_ELT_*
- t_creature* creat; //A pointer on the creat if type == MAP_ELT_CREAT
- unsigned char timeleft_veget; //Timeleft for the vegetal if type == MAP_ELT_VEGET
- }t_map_element;
-
- //Store the map
- typedef struct _t_map
- {
- t_map_element** map;
- //Map size
- int x;
- int y;
- }t_map;
-
- //Initialize the map
- t_map* create_map(int x, int y);
-
- //Re-generation of the vegetals
- void map_regen_veget(t_map* mp);
-
- //Print a sample of the map on stdout
- void disp_map(t_map* mp, int xbeg, int ybeg, int xend, int yend);
-
- #endif
|