mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Support for agent death
This commit is contained in:
parent
f6221436a4
commit
64ea015a06
4 changed files with 20 additions and 5 deletions
4
agent.h
4
agent.h
|
@ -14,16 +14,20 @@ public:
|
|||
class tile *tile;
|
||||
|
||||
int energy;
|
||||
bool dead;
|
||||
|
||||
agent(int id_, class tile &tile_, class connection *conn_)
|
||||
: id (id_), conn (conn_), tile (&tile_)
|
||||
{
|
||||
put_at(tile_);
|
||||
energy = world::newborn_energy;
|
||||
dead = false;
|
||||
};
|
||||
|
||||
bool move_dir(int dir_x, int dir_y);
|
||||
|
||||
void die(void);
|
||||
|
||||
void on_action_takes(void);
|
||||
void on_tick(void);
|
||||
void on_senses_update(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue