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

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit4.h"
#include <shdocvw_ocx.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  Abalone = new Game;
  Abalone->SetGameState(0);
  Abalone->DataMatrix.setDestX(0);
  Abalone->DataMatrix.setDestY(0);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::RadioButton4Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitSchwarz.bmp");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton5Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitRot.bmp");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton6Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitBlau.bmp");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton7Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitGelb.bmp");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton8Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitCyane.bmp");        
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton9Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("DiplomarbeitViolett.bmp");        
}
//---------------------------------------------------------------------------


void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
  if (RadioButton1->Checked)
  {
    Abalone->GameNormalMode();
    if (Abalone->GetGameState() == 1)
    {
      if (Form1->CheckBox1->Checked == true)
      {
        Abalone->abaOptions->setTimer(true);
        Form1->Label7->Caption = IntToStr(Abalone->abaOptions->getMaxPoints());
        Form1->Label8->Caption = IntToStr(Abalone->abaOptions->getMaxPoints());
      }
      else
      {
        Abalone->abaOptions->setTimer(false);
        Form1->Label7->Caption = "0";
        Form1->Label8->Caption = "0";
      }
      Abalone->SetNewGame(false);
      Form1->Label11->Caption = "Normal Mode";
      Form1->Label10->Caption = Abalone->activePlayer->getName();
      Form1->ImageList1->GetBitmap(Abalone->activePlayer->getStoneC()-1,Form1->Image45->Picture->Bitmap);
      Form1->Image45->Refresh();
      Abalone->activePlayer->setScore(Abalone->abaOptions->getMaxPoints());
      Abalone->inactivePlayer->setScore(Abalone->abaOptions->getMaxPoints());
    }
  }
  else if (RadioButton2->Checked)
  {
  }
  else if (RadioButton3->Checked)
  {
  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image8Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(6,2);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image8->Picture->Bitmap);
    Form1->Image8->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image9Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(8,2);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image9->Picture->Bitmap);
    Form1->Image9->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image10Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(10,2);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image10->Picture->Bitmap);
    Form1->Image10->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image11Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(12,2);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image11->Picture->Bitmap);
    Form1->Image11->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image12Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(14,2);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image12->Picture->Bitmap);
    Form1->Image12->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image13Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(5,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image13->Picture->Bitmap);
    Form1->Image13->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image14Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(7,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image14->Picture->Bitmap);
    Form1->Image14->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image15Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(9,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image15->Picture->Bitmap);
    Form1->Image15->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image16Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(11,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image16->Picture->Bitmap);
    Form1->Image16->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image17Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(13,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image17->Picture->Bitmap);
    Form1->Image17->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image18Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(15,3);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image18->Picture->Bitmap);
    Form1->Image18->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image19Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(4,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image19->Picture->Bitmap);
    Form1->Image19->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image20Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(6,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image20->Picture->Bitmap);
    Form1->Image20->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image21Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(8,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image21->Picture->Bitmap);
    Form1->Image21->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image22Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(10,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image22->Picture->Bitmap);
    Form1->Image22->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image23Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(12,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image23->Picture->Bitmap);
    Form1->Image23->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image24Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(14,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image24->Picture->Bitmap);
    Form1->Image24->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image25Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(16,4);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image25->Picture->Bitmap);
    Form1->Image25->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image26Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(3,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image26->Picture->Bitmap);
    Form1->Image26->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image27Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(5,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image27->Picture->Bitmap);
    Form1->Image27->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image28Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(7,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image28->Picture->Bitmap);
    Form1->Image28->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image29Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(9,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image29->Picture->Bitmap);
    Form1->Image29->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image30Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(11,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image30->Picture->Bitmap);
    Form1->Image30->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image31Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(13,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image31->Picture->Bitmap);
    Form1->Image31->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image32Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(15,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image32->Picture->Bitmap);
    Form1->Image32->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image33Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(17,5);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image33->Picture->Bitmap);
    Form1->Image33->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Image34Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(2,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image34->Picture->Bitmap);
    Form1->Image34->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image35Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(4,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image35->Picture->Bitmap);
    Form1->Image35->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image36Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(6,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image36->Picture->Bitmap);
    Form1->Image36->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image37Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(8,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image37->Picture->Bitmap);
    Form1->Image37->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image38Click(TObject *Sender)
{
int StoneColor = Abalone->CheckStatus(10,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image38->Picture->Bitmap);
    Form1->Image38->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image39Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(12,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image39->Picture->Bitmap);
    Form1->Image39->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image40Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(14,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image40->Picture->Bitmap);
    Form1->Image40->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image41Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(16,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image41->Picture->Bitmap);
    Form1->Image41->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image42Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(18,6);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image42->Picture->Bitmap);
    Form1->Image42->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image43Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(3,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image43->Picture->Bitmap);
    Form1->Image43->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image44Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(5,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image44->Picture->Bitmap);
    Form1->Image44->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image46Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(7,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image46->Picture->Bitmap);
    Form1->Image46->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image47Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(9,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image47->Picture->Bitmap);
    Form1->Image47->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image48Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(11,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image48->Picture->Bitmap);
    Form1->Image48->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image49Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(13,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image49->Picture->Bitmap);
    Form1->Image49->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image50Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(15,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image50->Picture->Bitmap);
    Form1->Image50->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image51Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(17,7);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image51->Picture->Bitmap);
    Form1->Image51->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image52Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(4,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image52->Picture->Bitmap);
    Form1->Image52->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image53Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(6,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image53->Picture->Bitmap);
    Form1->Image53->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image54Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(8,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image54->Picture->Bitmap);
    Form1->Image54->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image55Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(10,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image55->Picture->Bitmap);
    Form1->Image55->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image56Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(12,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image56->Picture->Bitmap);
    Form1->Image56->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image57Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(14,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image57->Picture->Bitmap);
    Form1->Image57->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image58Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(16,8);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image58->Picture->Bitmap);
    Form1->Image58->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image59Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(5,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image59->Picture->Bitmap);
    Form1->Image59->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image60Click(TObject *Sender)
{
int StoneColor = Abalone->CheckStatus(7,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image60->Picture->Bitmap);
    Form1->Image60->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image61Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(9,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image61->Picture->Bitmap);
    Form1->Image61->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image62Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(11,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image62->Picture->Bitmap);
    Form1->Image62->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image63Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(13,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image63->Picture->Bitmap);
    Form1->Image63->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image64Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(15,9);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image64->Picture->Bitmap);
    Form1->Image64->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image65Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(6,10);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image65->Picture->Bitmap);
    Form1->Image65->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image66Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(8,10);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image66->Picture->Bitmap);
    Form1->Image66->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image67Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(10,10);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image67->Picture->Bitmap);
    Form1->Image67->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image68Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(12,10);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image68->Picture->Bitmap);
    Form1->Image68->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image69Click(TObject *Sender)
{
  int StoneColor = Abalone->CheckStatus(14,10);
  if (StoneColor > 0 && StoneColor < 99)
  {
    Form1->ImageList1->GetBitmap(StoneColor-1,Form1->Image69->Picture->Bitmap);
    Form1->Image69->Refresh();
  }
  Abalone->Play();
}
//---------------------------------------------------------------------------



void __fastcall TForm1::QuitGame1Click(TObject *Sender)
{
  Form1->Close();        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::InfoaboutGame1Click(TObject *Sender)
{
  Form2->ShowModal();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::NewGame1Click(TObject *Sender)
{
  if (RadioButton1->Checked)
  {
    Abalone->GameNormalMode();
    if (Abalone->GetGameState() == 1)
    {
      if (Form1->CheckBox1->Checked == true)
      {
        Abalone->abaOptions->setTimer(true);
        Form1->Label7->Caption = IntToStr(Abalone->abaOptions->getMaxPoints());
        Form1->Label8->Caption = IntToStr(Abalone->abaOptions->getMaxPoints());
      }
      else
      {
        Abalone->abaOptions->setTimer(false);
        Form1->Label7->Caption = "0";
        Form1->Label8->Caption = "0";
      }
      TimeCounter = 0;
      Abalone->SetNewGame(false);
      Form1->Label11->Caption = "Normal Mode";
      Form1->Label10->Caption = Abalone->activePlayer->getName();
      Form1->ImageList1->GetBitmap(Abalone->activePlayer->getStoneC()-1,Form1->Image45->Picture->Bitmap);
      Form1->Image45->Refresh();
      Abalone->activePlayer->setScore(Abalone->abaOptions->getMaxPoints());
      Abalone->inactivePlayer->setScore(Abalone->abaOptions->getMaxPoints());
    }
  }
  else if (RadioButton2->Checked)
  {
  }
  else if (RadioButton3->Checked)
  {
  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
  Form4->ShowModal();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::HowtoPlay1Click(TObject *Sender)
{
  AnsiString FileName = ExtractFileDir(Application->ExeName);
  Form3->CppWebBrowser1->Navigate(WideString(FileName +"\\AbaloneGames_com.htm"));
  Form3->ShowModal();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::CheckBox1Click(TObject *Sender)
{
  if (Abalone->GetGameState() != 0)
  {
    Abalone->Message->ShowMessage(9);
  }
}
//---------------------------------------------------------------------------





void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  if (Abalone->GetGameState() > 0)
  {
    Form1->Edit1->Text = TimeCounter;
    TimeCounter++;
  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Timer2Timer(TObject *Sender)
{
  if (Abalone->GetGameState() != 0 && Abalone->abaOptions->getTimer() == true)
  {
    if (TimeCounter >= Abalone->abaOptions->getMaxTime() * 60)
    {
      Abalone->activePlayer->setScore(Abalone->activePlayer->getScore() - 1);
      Abalone->inactivePlayer->setScore(Abalone->activePlayer->getScore() - 1);
      if (Abalone->activePlayer->getID() == 1)
      {
        Form1->Label7->Caption = IntToStr(Abalone->activePlayer->getScore());
      }
      else
      {
        Form1->Label8->Caption = IntToStr(Abalone->activePlayer->getScore());
      }
    }
  }
}
//---------------------------------------------------------------------------

