mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-03 18:33:39 +02:00
Fix agent initialization
This commit is contained in:
parent
de392f4c7a
commit
ada1d0a6c9
1 changed files with 4 additions and 4 deletions
8
agent.h
8
agent.h
|
@ -24,13 +24,13 @@ public:
|
||||||
bool dead;
|
bool dead;
|
||||||
|
|
||||||
agent(int id_, class connection *conn_, class map &map_)
|
agent(int id_, class connection *conn_, class map &map_)
|
||||||
: id (id_), conn (conn_), map (map_)
|
: id (id_), conn (conn_), map (map_), tile (NULL)
|
||||||
{
|
{
|
||||||
energy = world::newborn_energy;
|
|
||||||
dead = false;
|
|
||||||
attr.move = 1.0;
|
attr.move = 1.0;
|
||||||
attr.attack = 0.5;
|
attr.attack = 0.5;
|
||||||
attr.defense = 0.5;
|
attr.defense = 0.5;
|
||||||
|
energy = world::newborn_energy;
|
||||||
|
dead = false;
|
||||||
};
|
};
|
||||||
void spawn(void);
|
void spawn(void);
|
||||||
void spawn_at(class tile &tile);
|
void spawn_at(class tile &tile);
|
||||||
|
@ -53,10 +53,10 @@ public:
|
||||||
herb(int id_, class map &map_)
|
herb(int id_, class map &map_)
|
||||||
: agent(id_, NULL, map_)
|
: agent(id_, NULL, map_)
|
||||||
{
|
{
|
||||||
energy = world::herb_energy;
|
|
||||||
attr.move = 0;
|
attr.move = 0;
|
||||||
attr.attack = 0;
|
attr.attack = 0;
|
||||||
attr.defense = 0;
|
attr.defense = 0;
|
||||||
|
energy = world::herb_energy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_tick(void);
|
void on_tick(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue