#ifndef ROBOT_DEF
 #define ROBOT_DEF


//------------------------ ROBOT Module -------------------------//
//						  v 11 . 03 .  2007						 //
//																 //
//								MT								 //
//---------------------------------------------------------------//


//---------------------- Incudes 
#include "stdlib.h"
#include "stdio.h"

#include "socket.hpp"
#include "data.hpp"
#include "commands.hpp"
#include "math.h"
//====================== Includes



//---------------------- Defines
#define PI2 6.283185307179586476925286766559
//====================== Defines



// ---------------- CDATA -------------- //
class CRobot{
	
	CData *Data;
	CSocket *Socket;

	int turn_;
	int make_;

public :	
	CRobot (CData *d, CSocket *s);

	void Pass();
		
	//--- Abilities ---//
	void Turn();
	void Prod(int n);
	void Sell(int n, int cost);
	void Buy (int n, int cost);
	void Upgrade();
	void ABuild();

	//--- Macroses ---//
	int IsWin();
	int IsNeedInAutoPlants();
	int MaxProducing(CGamer &player);

	int GetClearProfit(CGamer &player, int sell_price);
	int GetAllPlayers_Prod();
	int GetAllPlayers_Raw();
	int GetAllPlayers_Producing();
	
	int GetPlayingGamers();
	int GetPlayerOptimalBuyN(CGamer &player, int to_prod);
	int	GetPlayerOptimalProdN(CGamer &player);

	

	//--- Humor ---//
	void DeadPlayers();

 };

	
	struct spoint { double x; double p; };


#endif
