mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Create an agent
This commit is contained in:
parent
a131964cc0
commit
32dc354e60
4 changed files with 29 additions and 2 deletions
16
agent.cc
Normal file
16
agent.cc
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue