X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=blobdiff_plain;f=agents%2Fc%2B%2B%2Fagent.h;fp=agents%2Fc%2B%2B%2Fagent.h;h=9c05edd87ab96ba98df4551b6998a202a001629e;hp=0000000000000000000000000000000000000000;hb=159708785516e4dd5a1ddceadd1e371f48dd3d23;hpb=c2fbd2e5499e4817c156f9dbabea5215d83729dd diff --git a/agents/c++/agent.h b/agents/c++/agent.h new file mode 100644 index 0000000..9c05edd --- /dev/null +++ b/agents/c++/agent.h @@ -0,0 +1,39 @@ +/** + * agent++ : A Sample agent for UCC::Progcomp2013 + * @file agent.h + * @purpose Declaration of Agent class + */ + +#ifndef _AGENT_H +#define _AGENT_H + +#include +#include +#include "qchess.h" // Declarations of Board, Piece and Square classes; see also qchess.cpp + +/** + * @class Agent + * @purpose Class that represents an agent which will play qchess + */ +class Agent +{ + public: + Agent(const std::string & colour); // initialise with colour + virtual ~Agent(); // destructor + + void Run(std::istream & in, std::ostream & out); // agent run loop, specify input and output streams + + virtual Square & Select(); // select a square (default: random square containing one of my pieces) + virtual Square & Move(); // select a move (default: random valid move for selected piece) + + + protected: + const Piece::Colour colour; // colour of the agent; do not change it + Board board; // board, see qchess.h + Piece * selected; // last piece chosen by Agent::Select, see qchess.h + +}; + +#endif //_AGENT_H + +//EOF