mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Support for agent death
This commit is contained in:
parent
f6221436a4
commit
64ea015a06
4 changed files with 20 additions and 5 deletions
|
@ -11,10 +11,10 @@
|
|||
#include "connection.h"
|
||||
|
||||
void
|
||||
connection::senses(int tick_id, int energy, char around[4])
|
||||
connection::senses(int tick_id, bool dead, int energy, char around[4])
|
||||
{
|
||||
char buf[1024];
|
||||
snprintf(buf, sizeof(buf), "tick %d\nenergy %d\naround %c%c%c%c\n\n", tick_id, energy, around[0], around[1], around[2], around[3]);
|
||||
snprintf(buf, sizeof(buf), "tick %d\n%senergy %d\naround %c%c%c%c\n\n", tick_id, dead ? "DEAD\n" : "", energy, around[0], around[1], around[2], around[3]);
|
||||
|
||||
pthread_mutex_lock(&buf_lock);
|
||||
out_buf.append(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue