tile::symbol() -> ::type_symbol(), ::symbol() accounts for agent id

This commit is contained in:
Petr Baudis 2011-11-26 19:26:32 +01:00
parent ce6f46ef1c
commit 8e78efd7d8
2 changed files with 13 additions and 3 deletions

11
map.cc
View file

@ -1,6 +1,7 @@
#include <iostream>
#include <cassert>
#include "agent.h"
#include "map.h"
void
@ -22,7 +23,15 @@ tile::on_tick(void)
}
char
tile_ground::symbol(void)
tile::symbol(void)
{
if (agent)
return '0' + (agent->id % 10);
return type_symbol();
}
char
tile_ground::type_symbol(void)
{
return '.';
}

5
map.h
View file

@ -13,11 +13,12 @@ public:
virtual void on_tick(void);
virtual char symbol(void) = 0;
char symbol(void);
virtual char type_symbol(void) = 0;
};
class tile_ground : public tile {
char symbol(void);
char type_symbol(void);
};
class position {