示例#1
0
bool CProcessor::OutputFacts(CTextProcessor& text)
{
    TGuard<TMutex> guard(OutputLock);

    SentenceCount += text.GetSentenceCount();
    TouchedSentenceCount += text.m_iTouchedSentencesCount;

    const SDocumentAttribtes& attr = text.GetAttributes();

    if (XmlWriter.Get() != NULL)
        XmlWriter->AddFacts(text, attr.m_strUrl);

    if (ProtoWriter.Get() != NULL)
        ProtoWriter->AddFacts(text, attr.m_strUrl);

    if (PlainTextWriter.Get() != NULL)
        PlainTextWriter->AddDocument(&text);

    if (MapReduceMode)
        OutputMapReduceFacts(attr.m_strUrl);

    if (PrettyXMLWriter.Get() != NULL)
        PrettyXMLWriter->AddDocument(&text, "");

    PrintSpeed(attr.m_strUrl);
    return true;
}
示例#2
0
文件: tetris.cpp 项目: milon/Tetris
int IncreaseSpeed()
{	if(Speed-5 <= 0)
		return 1;
	Speed -= 5;             //increase the speed, lower the number, higher the speed
	Level++;                //speed & level increase together
	PrintSpeed();
	PrintLevel();
	return 0;
}
示例#3
0
文件: tetris.cpp 项目: milon/Tetris
void DisplayScreen()
{	setcolor(15);
	rectangle(156,26,478,452);                                      //for border of play box
	rectangle(158,28,476,450);					//for play box
	DrawBox(488,300,620,450, YELLOWBR, YELLOW, YELLOWDR);		//for next brick bar
	DrawBox(488,28,620,290, YELLOWBR, YELLOW, YELLOWDR);		//for information bar
	DrawBox(10,255,150,450, YELLOWBR, YELLOW, YELLOWDR);		//for instruction bar
	setcolor(PURPLE);
	settextstyle(0,0,1);
	outtextxy(500,310, "Next");
	outtextxy(538,310,"Brick");
	setcolor(PURPLE);
	outtextxy(500,40, "Score");
	setcolor(GREEN);
	rectangle(500,50,608,70);                       //for score box
	setcolor(PURPLE);
	settextstyle(0,0,1);
	outtextxy(500,100, "Level");
	setcolor(GREEN);
	rectangle(500,110,608,130);                     //for level box
	setcolor(PURPLE);
	outtextxy(500,160, "Speed");
	setcolor(GREEN);
	rectangle(500,170,608,190);                     //for speed box
	setcolor(PURPLE);
	outtextxy(500,220, "Lines");
	outtextxy(547,220,"Cleared");
	setcolor(GREEN);
	rectangle(500,230,608,250);			//for line cleared box
	PrintScore();                                   //Display scorecard
	PrintSpeed();                                   //Display speed
	PrintLevel();                                   //Display level
	PrintLinesCleared();                            //Display lines cleared
	setcolor(REDBR);
	settextstyle(10,1,4);
	outtextxy(0,30, "Aguntuk");				//for name
	outtextxy(60,60, "Bricks");
	setcolor(GREEN);
	settextstyle(8,0,2);
	outtextxy(20,255,"KEYS:");
	settextstyle(0,0,1);
	setcolor(PURPLE);
	outtextxy(20,290,"Left");
	setlinestyle(0,0,2);
	line(100,293,103,290);                          //for left arrow's \
	line(100,293,103,296);                          //for left arrow's /
	line(100,293,109,293);				//for left arrow's hyphen
	outtextxy(20,310,"Right");
	line(109,313,106,310);                          //for right arrow's \
	line(100,313,109,313);                          //for right arrow's hyphen
	line(109,313,106,316);                          //for right arrow's /
	outtextxy(20,330,"Rotate");
	outtextxy(100,330,"^");
	line(103,330, 103, 340);			//for up arrow's hyphen
	outtextxy(20,350,"Drop");
	line(103,350, 103, 360);			//for down arrow's hyphen
	line(100,357, 103, 360);			//for down arrow's \
	line(106,357, 103, 360);			//for down arrow's /
	outtextxy(20,370,"Pause");
	outtextxy(100,370,"P");
	outtextxy(20,390,"Sound");
	outtextxy(100,390,"S");
	outtextxy(20,410,"About");
	outtextxy(100,410,"A");
	outtextxy(20,430,"Exit");
	outtextxy(100,430,"Esc");
	setcolor(GREEN);
}