MyCurOch = ZnachKub1 + ZnachKub2 + ZnachKub3;
MyWholeOch = MyWholeOch + MyCurOch;
strcpy (strSend, DannieToChar (1, MyCurOch, MyWholeOch, ​​ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2, ZnachKub3, XKub3, YKub3));
}
else
{
int ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2, ZnachKub3, XKub3, YKub3, ZnachKub4, XKub4, YKub4;
randomize ();
ZnachKub1 = random (6) +1;
XKub1 = random (52) +14;
YKub1 = random (52) +14;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub1) + strCat);
Kubiki1 [0] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [0] -> Left = XKub1;
Kubiki1 [0] -> Top = YKub1;
Kubiki1 [0] -> Visible = true;
ZnachKub2 = random (6) +1;
XKub2 = random (52) +88;
YKub2 = random (52) +14;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub2) + strCat);
Kubiki1 [1] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [1] -> Left = XKub2;
Kubiki1 [1] -> Top = YKub2;
Kubiki1 [1] -> Visible = true;
ZnachKub3 = random (6) +1;
XKub3 = random (52) +14;
YKub3 = random (52) +88;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub3) + strCat);
Kubiki1 [2] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [2] -> Left = XKub3;
Kubiki1 [2] -> Top = YKub3;
Kubiki1 [2] -> Visible = true;
ZnachKub4 = random (6) +1;
XKub4 = random (52) +88;
YKub4 = random (52) +88;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub4) + strCat);
Kubiki1 [3] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [3] -> Left = XKub4;
Kubiki1 [3] -> Top = YKub4;
Kubiki1 [3] -> Visible = true;
MyCurOch = ZnachKub1 + ZnachKub2 + ZnachKub3 + ZnachKub4;
MyWholeOch = MyWholeOch + MyCurOch;
strcpy (strSend, DannieToChar (1, MyCurOch, MyWholeOch, ​​ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2, ZnachKub3, XKub3, YKub3, ZnachKub4, XKub4, YKub4));
}
switch (choosenProt)
{
case 0:
IPXSend (strSend);
break;
case 1:
TCPIPSend (AnsiString (strSend));
break;
case 2:
NetBiosSend (strSend);
break;
case 3:
MailSlotSend (strSend);
break;
case 4:
PipeSend (strSend);
break;
}
enum TypeDannihForTabl DannieForTabl;
DannieForTabl = yabrosil;
ZapolnTabl (DannieForTabl);
lbMyWholeOch-> Caption = MyWholeOch;
if (MyWholeOch> MaxOch)
{
lbMyWholeOch-> Font-> Color = clRed;
ViProigrali ();
}
else if (IsHeFixed && MyWholeOch> HisWholeOch && MyWholeOch <= MaxOch)
{
ViViigrali ();
}
else if (IsHeFixed && MyWholeOch <= HisWholeOch)
{
ChangeInterfacePerehodHoda (1);
}
else
{
ChangeInterfacePerehodHoda (0);
}
delete Bitmap1;
}
// --------------------------------------------- ------------------------------
void __ fastcall TMainForm :: btFix2Click (TObject * Sender)
{
IsYaFixed = true;
if (IsServer)
{
NomHoda + +;
}
btFix-> Color = clRed;
btBrosit-> Color = clCream;
lbMyWholeOch-> Font-> Color = clRed;
switch (choosenProt)
{
case 0:
IPXSend ("2;");
break;
case 1:
TCPIPSend ("2;");
break;
case 2:
NetBiosSend ("2;");
break;
case 3:
MailSlotSend ("2;");
break;
case 4:
PipeSend ("2;");
break;
}
enum TypeDannihForTabl DannieForTabl;
DannieForTabl = yafixed;
ZapolnTabl (DannieForTabl);
if (IsHeFixed && MyWholeOch == HisWholeOch)
{
Nichia ();
}
else if (MyWholeOch
{
ViProigrali ();
}
else
{
ChangeInterfacePerehodHoda (0);
}
}
// --------------------------------------------- ------------------------------
Ipx.cpp
// --------------------------------------------- ------------------------------
# pragma hdrstop
# include
# include
# include "IPX.h"
# include "Main.h"
# include "Podkluch.h"
// ---------------------------------------------...