本文整理汇总了C++中Converter::convertIn方法的典型用法代码示例。如果您正苦于以下问题:C++ Converter::convertIn方法的具体用法?C++ Converter::convertIn怎么用?C++ Converter::convertIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::convertIn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main ()
{
GameStatus gameStatus;
Converter converter;
Player homePlayer1;
Player homePlayer2;
Player awayPlayer1;
Player awayPlayer2;
Ball ball;
srand(time(NULL));
int pohotnostRand, pozicioniranjeRand, dodavanjeRand, strat;
bool stratFlipFlop, scoreFlipFlop;
int successCounter [12];
int mainMainCounter = 0;
double px0,py0,px1,py1,px2,py2,px3,py3;
bool presreci01,presreci02,presreci03; // homePlayer1
bool presreci11,presreci12,presreci13; // homePlayer2
bool presreci21,presreci22,presreci23; // awayPlayer1
bool presreci31,presreci32,presreci33; // awayPlayer2
double vremePr0,vremePr1,vremePr2,vremePr3;
for (int i=0;i<12;i++) successCounter[i]=0;
while (true)
{/*if (LogFajl.is_open() != true)
LogFajl.open("Izlaz.txt",ios::app);*/
//start input
//10 //20 //30 //40
gameStatus.inputGameStatus();
//50 //60 //70 //80
homePlayer1.inputPos();
homePlayer2.inputPos();
awayPlayer1.inputPos();
awayPlayer2.inputPos();
//90 //100 //110 //120
ball.inputPos();
ball.inputVel();
//130 //140 //150
homePlayer1.inputHasKicked();
homePlayer2.inputHasKicked();
awayPlayer1.inputHasKicked();
awayPlayer2.inputHasKicked();
//end input
//Player nizIgraca[4] = {homePlayer1,homePlayer2,awayPlayer1,awayPlayer2};
// IN CONVERSION
converter.convertIn(homePlayer1,homePlayer2,awayPlayer1,awayPlayer2,ball,gameStatus);
// double a1,b1;
//odrediTackuOdbijanja(1,-398,a1,b1,ball); // !!!!!******!!!!!*******!!!!!!
//cout << "INTERSECTION POINT: " << a1 << " " << b1 << endl;
//start calc
if ((ball.getXPos()>0) && (ball.getXPos()<g_fieldLength)) mainMainCounter++;
if ((mainMainCounter<6000) && gameStatus.getReset() && stratFlipFlop)
{
stratFlipFlop = false;
strat = rand() % 12;
if (strat < 12)
{
pohotnostRand = strat % 3;
pozicioniranjeRand = strat % 2;
dodavanjeRand = strat / 6;
}
}
if (mainMainCounter >= 6000)
{
int pohotnostSuccess[3]={0,0,0},pozicioniranjeSuccess[2]={0,0},dodavanjeSuccess[2]={0,0};
for (int i=0;i<12;i++)
{
pohotnostSuccess[i%3] += successCounter[i];
pozicioniranjeSuccess[i%2] += successCounter[i];
dodavanjeSuccess[i/6] += successCounter[i];
}
int pohotnostMaxI = maximumN(pohotnostSuccess,3),pozicioniranjeMaxI = maximumN(pozicioniranjeSuccess,2),dodavanjeMaxI = maximumN(dodavanjeSuccess,2);
if (pohotnostMaxI == 0)
{
if (pozicioniranjeMaxI == 0) strat = 0 + 6*dodavanjeMaxI;
else strat = 3 + 6*dodavanjeMaxI;
}
if (pohotnostMaxI == 1)
{
if (pozicioniranjeMaxI == 0) strat = 4 + 6*dodavanjeMaxI;
else strat = 1 + 6*dodavanjeMaxI;
}
if (pohotnostMaxI == 2)
{
if (pozicioniranjeMaxI == 0) strat = 2 + 6*dodavanjeMaxI;
else strat = 5 + 6*dodavanjeMaxI;
//.........这里部分代码省略.........