PixelWars/src/dude.h
2016-05-30 17:20:37 +02:00

41 lines
1.1 KiB
C++

#ifndef DUDE_H
#define DUDE_H
#include "behavior.h"
class Dude : public Info
{
private:
Coord m_pos;
Map *p_map;
int m_team;
bool m_dead;
bool m_success;
PixelType m_inventory;
PixelType m_under;
int m_underResCount;
char m_memory[DUDE_MEMORY_SIZE];
Action m_action; // action containing output com data
Com m_com_data; // input com data
public:
Dude(const Coord &_pos, Map *_map, int &_team);
const Action& getAction() { return m_action; }
int getTeam(){ return m_team; }
void setSuccess(bool success) { m_success = success; }
void setInventory(PixelType item) { m_inventory = item; }
void perish() { m_dead = true; }
const Coord& getPos() { return m_pos; }
void move(Dir d);
void receiveComData(Dir dir, const char *data);
void update(BehaviorFunction func);
virtual bool getSuccess() const { return m_success; }
virtual PixelType getInventory() const { return m_inventory; }
virtual const Com& getCom() const { return m_com_data; }
virtual PixelType getNear(Dir d) const;
virtual int getInfo(Dir d) const;
};
#endif // DUDE_H