Create an agent

This commit is contained in:
Petr Baudis 2011-11-26 19:41:03 +01:00
parent a131964cc0
commit 32dc354e60
4 changed files with 29 additions and 2 deletions

16
agent.cc Normal file
View file

@ -0,0 +1,16 @@
#include <cassert>
#include <cstdlib>
#include <iostream>
#include "agent.h"
#include "map.h"
void
agent::put_at(struct position *pos)
{
class tile *t = &pos->map->tile_at(*pos);
if (!t->on_agent_enter(this)) {
std::cerr << "Collision.";
exit(EXIT_FAILURE);
}
}