p> __fastcall TMainForm :: TMainForm (TComponent * Owner)
: TForm (Owner)
{
}
// --------------------------------------------- ------------------------------
void __ fastcall TMainForm :: FormCreate (TObject * Sender)
{
FirstTimeShow = true;
IsVisitApplicationBox = false;
}
// --------------------------------------------- ------------------------------
void __ fastcall TMainForm :: FormActivate (TObject * Sender)
{
if (FirstTimeShow)
{
FirstTimeShow = false;
InterfaceBezIgri ();
menuBeginClick (this);
}
}
// --------------------------------------------- ------------------------------
void __ fastcall TMainForm :: menuBeginClick (TObject * Sender)
{
if (IsIgrayut)
{
menuStopClick (this);
if (IsIgrayut) return;
}
if (UstanParametrov ())// Виклик 2-х форм для установки параметрів
{
// ---- підключення ----
switch (choosenProt)
{
case 0:
IPXConnect ();
break;
case 1:
TCPIPConnect ();
break;
case 2:
NetBiosConnect ();
break;
case 3:
MailSlotConnect ();
break;
case 4:
PipeConnect ();
break;
}
if (IsServer) lbStat-> Caption = "Очікується з'єднання з клієнтом ... ";
}
}
// --------------------------------------------- ------------------------------
bool __ fastcall TMainForm :: UstanParametrov (void)
{
int md1, md2;
for (; ;)
{
md1 = FormParamConnect-> ShowModal ();
FormParamConnect-> Close ();
if (md1 == mrOk)
{
if (IsServer)
{
md2 = FormGameParam-> ShowModal ();
if (md2 == mrOk) return 1;
else continue;
}
else return 1;
}
else return 0;
}
}
void __ fastcall TMainForm :: OtobrazhDannihSopernika (int * MasPriem)
{
Graphics :: TBitmap * Bitmap2 = new Graphics :: TBitmap ();
AnsiString strCat;
if (IsServer)
{
strCat = "_2";
}
else
{
strCat = "";
}
if (KolKub == 1)
{
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [3]) + strCat);
Kubiki2 [0] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [0] -> Left = MasPriem [4];
Kubiki2 [0] -> Top = MasPriem [5];
Kubiki2 [0] -> Visible = true;
}
else if (KolKub == 2)
{
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [3]) + strCat);
Kubiki2 [0] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [0] -> Left = MasPriem [4];
Kubiki2 [0] -> Top = MasPriem [5];
Kubiki2 [0] -> Visible = true;
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [6]) + strCat);
Kubiki2 [1] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [1] -> Left = MasPriem [7];
Kubiki2 [1] -> Top = MasPriem [8];
Kubiki2 [1] -> Visible = true;
}
else if (KolKub == 3)
{
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [3]) + strCat);
Kubiki2 [0] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [0] -> Left = MasPriem [4];
Kubiki2 [0] -> Top = MasPriem [5];
Kubiki2 [0] -> Visible = true;
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [6]) + strCat);
Kubiki2 [1] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [1] -> Left = MasPriem [7];
Kubiki2 [1] -> Top = MasPriem [8];
Kubiki2 [1] -> Visible = true;
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [9]) + strCat);
Kubiki2 [2] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [2] -> Left = MasPriem [10];
Kubiki2 [2] -> Top = MasPriem [11];
Kubiki2 [2] -> Visible = true;
}
else
{
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [3]) + strCat);
Kubiki2 [0] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [0] -> Left = MasPriem [4];
Kubiki2 [0] -> Top = MasPriem [5];
Kubiki2 [0] -> Visible = true;
Bitmap2-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (MasPriem [6]) + strCat);
Kubiki2 [1] -> Picture-> Bitmap = Bitmap2;
Kubiki2 [1] -> Left = MasPriem [7];
Kubiki2 [1] -> Top = M...