//---------------------------------------------------------------------------

#ifndef set_unitH
#define set_unitH

//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include "set_code.h"
#include <ScktComp.hpp>
//---------------------------------------------------------------------------
class Tset_game : public TForm
{
__published:	// IDE-managed Components
        TMainMenu *MainMenu1;
        TMenuItem *File1;
        TMenuItem *Exit1;
        TMenuItem *NewGame1;
        TMenuItem *Cheatmode1;
        TStatusBar *Status;
        TTimer *Timer1;
        TClientSocket *ClientSocket;
        TServerSocket *ServerSocket;
        TMenuItem *NetPlay1;
        TMenuItem *Connect1;
        TMemo *Memo1;
        TEdit *Edit1;
        TMenuItem *Port1;
        TMenuItem *Disconnect1;
        TMenuItem *ScreenName1;

        void __fastcall NewGame1Click(TObject *Sender);
        void __fastcall Cheatmode1Click(TObject *Sender);
        void __fastcall Exit1Click(TObject *Sender);

        void __fastcall FormPaint(TObject *Sender);
        void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall Timer1Timer(TObject *Sender);
        void __fastcall Connect1Click(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall ServerSocketAccept(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall ServerSocketClientRead(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall ClientSocketRead(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall Edit1KeyPress(TObject *Sender, char &Key);
        void __fastcall Port1Click(TObject *Sender);
        void __fastcall ClientSocketConnect(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall Disconnect1Click(TObject *Sender);
        void __fastcall ScreenName1Click(TObject *Sender);
        void __fastcall ClientSocketDisconnect(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall ServerSocketClientDisconnect(TObject *Sender,
          TCustomWinSocket *Socket);
        void __fastcall ServerSocketClientConnect(TObject *Sender,
          TCustomWinSocket *Socket);
private:	// User declarations
public:		// User declarations
        __fastcall Tset_game(TComponent* Owner);

void  send_message(String command, String data);


    board_class board;   // pointer to the current game
    unsigned int game_time;

    String Server; // the game server
    unsigned int port;

    String screen_name;

    int connected;

    int is_server;
};
//---------------------------------------------------------------------------
extern PACKAGE Tset_game *set_game;
//---------------------------------------------------------------------------
#endif



