12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /*
- 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 CREATURE_LOGIC_H
- #define CREATURE_LOGIC_H
- #include"creature.h"
- #include"map.h"
- #include"config.h"
-
- /*
- creature_logic.h :
- Define struct, constant and functions about creature's decision and action.
- */
-
- #define MOVE_UP 0
- #define MOVE_DWN 1
- #define MOVE_RGHT 2
- #define MOVE_LFT 3
-
- #define PROBA_REPRO 1
- #define LOGIC_MAX_DIST_BORN 10
-
- #define LOGIC_ACTION_EATVEGET 1
- #define LOGIC_ACTION_CREAT 2
-
- typedef struct _t_action
- {
-
- }t_action;
-
-
- //Let the creature do a decision
- void creature_decision(t_map* mp,t_chain_creature* lst_creat, t_creature* creat, char* dead, t_chain_creature** ptr_head);
-
- //Return a list of action
- char check_action(t_map* mp, t_creature* creat, int* x, int* y);
- t_chain_creature* repro_creat(t_map* mp, t_chain_creature* lst_creat, t_creature* creat, t_tree_genome* gnome);
-
- //Do a random move to the creature
- void random_move(t_map* mp, t_creature* creat);
-
- void move_creat(t_map* mp, t_creature* creat,char dir);
-
- void fight_creat(t_map* mp, t_creature* creat1, t_creature* creat2, char* creat1_dead, t_chain_creature** ptr_head);
-
- #endif
|