mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Describe agent object lifetime
This commit is contained in:
parent
343762c3bb
commit
417a5235a0
1 changed files with 15 additions and 0 deletions
15
agent.h
15
agent.h
|
@ -7,6 +7,21 @@
|
|||
|
||||
class connection;
|
||||
|
||||
/* Agent object lifetime is slightly complicated, since an agent
|
||||
* may be tied to a tile or a connection or both:
|
||||
*
|
||||
* - tile set, connection set: active client or connected corpse
|
||||
* - tile set, connection NULL: herb or disconnected corpse
|
||||
* - tile NULL, connection set: negotiation or zombie connection with no corpse anymore
|
||||
*
|
||||
* Agents are created (we may not keep this list up to date) on incoming
|
||||
* connection, by blooming herb or when converting corpse to herb. Herbs
|
||||
* are immediately spawned (assigned a tile); clients are spawned only
|
||||
* after negotiation.
|
||||
*
|
||||
* Agents are destroyed in the main loop when they are completely abandoned,
|
||||
* i.e. both their tile and connection become NULL. */
|
||||
|
||||
class agent {
|
||||
public:
|
||||
int id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue