#ifndef _LEFTRIGHT_HORSE
#define _LEFTRIGHT_HORSE

#include "../shareddata.h"
#include "../horse.h"
#include "../random.h"

class LeftRightHorse : public Horse
{
	int up, down;
	public:
		LeftRightHorse() { 
			up = down = -1;
		}
		virtual int move(SharedData& sh)
		{
			if (up == -1)   up   = sh.m - 2;						
			if (down == -1)  down = sh.m - 2;						
			if (up > 0) { up --;     return encode(-1, 0); };
			if (down > 0) { down --; return encode(1, 0); };
			return 0;
		}
};

#endif
