mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Track agent energy
Base energy, move energy
This commit is contained in:
parent
4fe552a79e
commit
93882f79b9
5 changed files with 22 additions and 6 deletions
9
agent.h
9
agent.h
|
@ -2,19 +2,24 @@
|
|||
#define BRMLIFE__AGENT_H
|
||||
|
||||
#include "map.h"
|
||||
#include "world.h"
|
||||
|
||||
class connection;
|
||||
|
||||
class agent {
|
||||
public:
|
||||
int id;
|
||||
class tile *tile;
|
||||
class connection *conn;
|
||||
|
||||
class tile *tile;
|
||||
|
||||
int energy;
|
||||
|
||||
agent(int id_, class tile &tile_, class connection *conn_)
|
||||
: id (id_), tile (&tile_), conn (conn_)
|
||||
: id (id_), conn (conn_), tile (&tile_)
|
||||
{
|
||||
put_at(tile_);
|
||||
energy = world::newborn_energy;
|
||||
};
|
||||
|
||||
bool move_dir(int dir_x, int dir_y);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue