~agent(): Introduce proper destructor

This commit is contained in:
Petr Baudis 2011-11-26 23:36:10 +01:00
parent 1ed67c81b6
commit 07dbb9c4f9
2 changed files with 5 additions and 2 deletions

View file

@ -20,6 +20,11 @@ public:
void on_tick(void); void on_tick(void);
~agent()
{
tile->on_agent_leave(*this);
};
private: private:
/* Just for initial placement. */ /* Just for initial placement. */
void put_at(class tile &tile); void put_at(class tile &tile);

View file

@ -49,8 +49,6 @@ main(int argc, char *argv[])
usleep(1000000); usleep(1000000);
tick_id++; tick_id++;
} }
/* TODO: destroy agent cleanly */
} }
return 0; return 0;