mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
agent::spawn_at(): Disassociate from constructor, allow tile == NULL
This commit is contained in:
parent
3e5366a5c4
commit
7714906baa
3 changed files with 13 additions and 13 deletions
10
agent.h
10
agent.h
|
@ -16,13 +16,13 @@ public:
|
|||
int energy;
|
||||
bool dead;
|
||||
|
||||
agent(int id_, class tile &tile_, class connection *conn_)
|
||||
: id (id_), conn (conn_), tile (&tile_)
|
||||
agent(int id_, class connection *conn_)
|
||||
: id (id_), conn (conn_)
|
||||
{
|
||||
put_at(tile_);
|
||||
energy = world::newborn_energy;
|
||||
dead = false;
|
||||
};
|
||||
void spawn_at(class tile &tile);
|
||||
|
||||
bool move_dir(int dir_x, int dir_y);
|
||||
bool attack_dir(int dir_x, int dir_y);
|
||||
|
@ -35,10 +35,6 @@ public:
|
|||
void on_senses_update(void);
|
||||
|
||||
~agent();
|
||||
|
||||
private:
|
||||
/* Just for initial placement. */
|
||||
void put_at(class tile &tile);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue