本文整理汇总了C++中Terminal类的典型用法代码示例。如果您正苦于以下问题:C++ Terminal类的具体用法?C++ Terminal怎么用?C++ Terminal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Terminal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Terminal* term = new Terminal();
term->run();
delete term;
return 0;
}
开发者ID:vinterdo,项目名称:VTerminal,代码行数:7,代码来源:VTerminal.cpp
示例2: switch
void Switch::toggleTarget()
{
switch (targetType)
{
case T_DOOR:
{
Door* t = (Door*)target;
t->isOpen = !t->isOpen;
break;
}
case T_TERMINAL:
{
Terminal* t = (Terminal*)target;
t->toggle();
break;
}
case T_LEVEL_END:
{
levelNum++;
curr_level = getLevelString(levelNum);
loading = true;
// TEMP
songNum++;
changeSong = true;
}
}
}
开发者ID:Airtamis,项目名称:The-God-Core-Source,代码行数:28,代码来源:Switch.cpp
示例3: error
void CampTerminalMenuComponent::fillObjectMenuResponse(SceneObject* sceneObject,
ObjectMenuResponse* menuResponse, CreatureObject* player) const {
if (!sceneObject->isTerminal())
return;
Terminal* terminal = cast<Terminal*>(sceneObject);
if(terminal == NULL) {
error("Terminal is null in fillObjectMenuResponse");
return;
}
StructureObject* camp = cast<StructureObject*>(terminal->getControlledObject());
if(camp == NULL) {
error("Camp is null in fillObjectMenuResponse");
return;
}
TangibleObjectMenuComponent::fillObjectMenuResponse(sceneObject,
menuResponse, player);
/// Get Ghost
Reference<PlayerObject*> ghost = player->getSlottedObject("ghost").castTo<PlayerObject*>();
if (ghost == NULL) {
error("PlayerCreature has no ghost: " + String::valueOf(player->getObjectID()));
return;
}
if (!player->isInRange(terminal, 16)) {
return;
}
menuResponse->addRadialMenuItem(68, 3, "@camp:mnu_status");
/// Make sure player doesn't already have a camp setup somewhere else
for (int i = 0; i < ghost->getTotalOwnedStructureCount(); ++i) {
uint64 oid = ghost->getOwnedStructure(i);
ManagedReference<StructureObject*> structure = ghost->getZoneServer()->getObject(oid).castTo<StructureObject*>();
if (structure == camp) {
menuResponse->addRadialMenuItem(182, 3, "@camp:mnu_disband");
return;
}
}
SortedVector<ManagedReference<ActiveArea*> >* areas = camp->getActiveAreas();
ManagedReference<ActiveArea*> area = NULL;
for (int i = 0; i < areas->size(); ++i) {
area = areas->get(i);
if (area->isCampArea()) {
break;
}
area == NULL;
}
if (area != NULL && area->isCampArea() && (area.castTo<CampSiteActiveArea*>())->isAbandoned()) {
menuResponse->addRadialMenuItem(183, 3, "@camp:mnu_assume_ownership");
}
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:60,代码来源:CampTerminalMenuComponent.cpp
示例4: PrintHelp
void PrintHelp()
{
static const char * const help[] =
{
// Assume TTY has 72 columns. Let's try to keep everything to 70 max.
// 1 2 3 4 5 6 7
// 1234567890123456789012345678901234567890123456789012345678901234567890
"Enter a move using file letter, rank number for source and target.",
"For example, White moving king pawn forward two squares: e2e4.",
"To castle, just move the king two squares. Example: e1g1.",
"",
"You may also enter any of the following commands:",
"board Print the board now (see 'hide', 'show').",
"help Print this help text.",
"hide Print the board only when asked (see 'board', 'show').",
"new Start a new game.",
"quit Exit the game.",
"show Print the board every time it is your turn.",
"swap Swap sides with the computer.",
"time Adjust computer's think time (difficulty).",
NULL
};
TheTerminal.printline();
for (int i=0; help[i]; ++i)
{
TheTerminal.printline(help[i]);
}
TheTerminal.printline();
}
开发者ID:LiosanGOG,项目名称:chenard,代码行数:30,代码来源:ttychess.cpp
示例5: Resign
virtual void Resign(ChessSide iGiveUp, QuitGameReason reason)
{
switch (reason)
{
case qgr_resign:
switch (iGiveUp)
{
case SIDE_WHITE:
TheTerminal.printline("White resigns.");
break;
case SIDE_BLACK:
TheTerminal.printline("Black resigns.");
break;
}
break;
case qgr_lostConnection:
TheTerminal.printline("Lost connection.");
break;
case qgr_startNewGame:
TheTerminal.printline("Starting new game.");
break;
}
}
开发者ID:LiosanGOG,项目名称:chenard,代码行数:26,代码来源:ttychess.cpp
示例6: while
virtual ChessPlayer *CreatePlayer(ChessSide side)
{
while (humanSide == SIDE_NEITHER)
{
TheTerminal.print("Which side do you want to play (w, b, quit)? ");
std::string choice = TheTerminal.readline();
if (choice == "w")
{
humanSide = SIDE_WHITE;
}
else if (choice == "b")
{
humanSide = SIDE_BLACK;
}
else if (choice == "quit")
{
throw "Chess program exited.";
}
}
if (side == humanSide)
{
human = new HumanChessPlayer(*this);
return human;
}
else
{
computer = new ComputerChessPlayer(*this);
computer->SetTimeLimit(ComputerThinkTime);
computer->SetSearchBias(1);
computer->setResignFlag(false);
return computer;
}
}
开发者ID:LiosanGOG,项目名称:chenard,代码行数:34,代码来源:ttychess.cpp
示例7: Cudd_MinHammingDist
/**Function********************************************************************
Synopsis [Returns the minimum Hamming distance between f and minterm.]
Description [Returns the minimum Hamming distance between the
minterms of a function f and a reference minterm. The function is
given as a BDD; the minterm is given as an array of integers, one
for each variable in the manager. Returns the minimum distance if
it is less than the upper bound; the upper bound if the minimum
distance is at least as large; CUDD_OUT_OF_MEM in case of failure.]
SideEffects [None]
SeeAlso [Cudd_addHamming]
******************************************************************************/
int
Cudd_MinHammingDist(
DdManager *dd /* DD manager */,
DdNode *f /* function to examine */,
int *minterm /* reference minterm */,
int upperBound /* distance above which an approximate answer is OK */)
{
DdHashTable *table;
CUDD_VALUE_TYPE epsilon;
int res;
table = cuddHashTableInit(dd,1,2);
if (table == NULL) {
return(CUDD_OUT_OF_MEM);
}
epsilon = Cudd_ReadEpsilon(dd);
Terminal zero;
zero.set(0.0);
Cudd_SetEpsilon(dd,&zero);
//Cudd_SetEpsilon(dd,(CUDD_VALUE_TYPE)0.0);
res = cuddMinHammingDistRecur(f,minterm,table,upperBound);
cuddHashTableQuit(table);
Cudd_SetEpsilon(dd,epsilon);
return(res);
} /* end of Cudd_MinHammingDist */
开发者ID:saidalfaraby,项目名称:DTP4TC,代码行数:43,代码来源:cuddPriority.c
示例8: main
int main(){
cout << "Starting GUI..." << endl;
string systemdrive = get_env("SYSTEMDRIVE");
GDSPath = systemdrive + GDSPath;
WMPath = systemdrive + WMPath;
ShellPath = systemdrive + ShellPath;
Process proc = Process::Spawn(GDSPath, {WMPath, ShellPath});
proc.Wait();
Terminal term;
term.SetPointerVisibility(false);
term.SetPointerAutohide(true);
cout << "Ending remaining GUI processes...";
cout.flush();
bool found = true;
while(found){
found = false;
ifstream procinfostream(ProcInfoPath);
table procs = parsecsv(procinfostream);
for(auto row: procs.rows){
if(strtoul(row["parent"].c_str(), NULL, 0) == bt_getpid()){
bt_kill(strtoul(row["PID"].c_str(), NULL, 0));
found = true;
}
}
}
cout << "Done." << endl;
}
开发者ID:,项目名称:,代码行数:27,代码来源:
示例9: while
Terminal*
Grammar::getNamedNode ( Terminal & node, const string & name )
{
// This function only operates on the parent chain.
// We only want to output non-source-position dependent constructors for SgLocatedNodes. Test for this.
Terminal* parentNode = node.getBaseClass();
#if 0
string parentNodeName;
if (parentNode != NULL)
{
parentNodeName = parentNode->getName();
// printf ("parentNodeName = %s \n",parentNodeName.c_str());
}
// printf ("In Grammar::getNamedNode(): name = %s \n",name.c_str());
#endif
while ( parentNode != NULL && string(parentNode->getName()) != name )
// while ( (parentNode != NULL) && (parentNodeName != name) )
{
// printf ("node %s parent node: %s \n",name.c_str(),parentNode->getName().c_str());
parentNode = parentNode->getBaseClass();
}
if (parentNode != NULL)
{
// printf ("Found node %s parent node: %s \n",name.c_str(),parentNode->getName().c_str());
}
return parentNode;
}
开发者ID:brushington,项目名称:rose-develop,代码行数:31,代码来源:buildConstructorsWithoutSourcePositionInformation.C
示例10: buildConstructorWithoutSourcePositionInformation
void
Grammar::buildConstructorWithoutSourcePositionInformationSupport( Terminal & node, StringUtility::FileWithLineNumbers & outputFile )
{
StringUtility::FileWithLineNumbers editString = buildConstructorWithoutSourcePositionInformation(node);
editString = StringUtility::copyEdit (editString,"$CLASSNAME",node.getName());
editString = StringUtility::copyEdit (editString,"$GRAMMAR_NAME",getGrammarName()); // grammarName string defined in Grammar class
// Set these to NULL strings if they are still present within the string
editString = StringUtility::copyEdit (editString,"$CLASSTAG",node.getTagName());
#if 1
// Also output strings to single file
outputFile += editString;
#endif
// printf ("node.name = %s (# of subtrees/leaves = %" PRIuPTR ") \n",node.getName(),node.nodeList.size());
#if 1
// Call this function recursively on the children of this node in the tree
vector<Terminal *>::const_iterator treeNodeIterator;
for( treeNodeIterator = node.subclasses.begin();
treeNodeIterator != node.subclasses.end();
treeNodeIterator++ )
{
ROSE_ASSERT ((*treeNodeIterator) != NULL);
ROSE_ASSERT ((*treeNodeIterator)->getBaseClass() != NULL);
buildConstructorWithoutSourcePositionInformationSupport(**treeNodeIterator,outputFile);
}
#endif
}
开发者ID:brushington,项目名称:rose-develop,代码行数:31,代码来源:buildConstructorsWithoutSourcePositionInformation.C
示例11: main
int main (int argc, char** argv)
{
Terminal t;
t.func();
BoldDecorator bd(t);
bd.func();
BarEndlineDecorator(bd).func();
}
开发者ID:ppolcz,项目名称:workspace,代码行数:8,代码来源:decorator.cpp
示例12: f
/*
* Opens a terminal based on your DE.
*/
void WMHelper::openTerminal(const QString& dirName)
{
QFileInfo f(dirName);
if (f.exists())
{
Terminal *term = new Terminal(0, SettingsManager::getTerminal());
term->openTerminal(dirName);
}
}
开发者ID:ColinDuquesnoy,项目名称:octopi,代码行数:12,代码来源:wmhelper.cpp
示例13: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Terminal tm;
tm.run();
return a.exec();
}
开发者ID:vsensu,项目名称:CommandSystem,代码行数:9,代码来源:main.cpp
示例14: syslog
void Key::Execute(void *arg)
{
syslog(LOG_DEBUG, "%s ENTRY",__func__);
Terminal term;
while(1)
{
char ch = term.getch();
syslog(LOG_DEBUG,"new key pressed :%d ",ch);
write(getKeyFd[1],&ch,1);
}
}
开发者ID:renjithpk,项目名称:friendly-arm-robotics,代码行数:11,代码来源:appFW.cpp
示例15: strcpy
/*
* Player opened a mission terminal or pressed refresh
*/
void MissionManager::listRequest(PlayerObject* player, uint64 terminal_id,uint8 refresh_count)
{
Terminal* terminal = dynamic_cast<Terminal*> (gWorldManager->getObjectById(terminal_id));
//uint32 terminal_type = terminal->getTerminalType();
int8 terminal_name[255];
strcpy(terminal_name,terminal->getName().getAnsi());
gLogger->logMsgF("Terminal id %"PRIu64" is type '%s'", MSG_NORMAL, terminal_id, terminal_name);
int count = 0;
int len = strlen(terminal_name);
MissionBag* mission_bag = dynamic_cast<MissionBag*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_MissionBag));
MissionList::iterator it = mission_bag->getMissions()->begin();
while(it != mission_bag->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
mission->clear();
mission->setIssuingTerminal(terminal);
mission->setRefreshCount(refresh_count);
switch(len)
{
case 16: //terminal_mission
count < 5 ? generateDestroyMission(mission,terminal_id) : generateDeliverMission(mission);
break;
case 22: //terminal_mission_scout
if (count < 5) {
mission->setRefreshCount(0);
} else {
generateReconMission(mission);
}
break;
case 24: //terminal_mission_artisan
count < 5 ? generateCraftingMission(mission) : generateSurveyMission(mission);
break;
case 28: //terminal_mission_entertainer
generateEntertainerMission(mission,count);
break;
default:
gLogger->logMsgF("Terminal id %"PRIu64" is type '%s'", MSG_NORMAL, terminal_id, terminal_name);
mission->setRefreshCount(0);
}
gMessageLib->sendMISO_Delta(mission, player);
count++;
++it;
}
}
开发者ID:Arnold47525,项目名称:mmoserver,代码行数:56,代码来源:MissionManager.cpp
示例16: main
int main(int argc, char *argv[]){
QGuiApplication app(argc, argv);
app.setApplicationName("Nutron");
app.setApplicationVersion("1.0");
QQmlApplicationEngine engine;
QQmlContext *ctx = engine.rootContext();
Terminal console;
Authenticate validate(console.get_userList());
ctx->setContextProperty("_console",&console);
ctx->setContextProperty("_authenticate",&validate);
engine.load(QUrl(QStringLiteral("qrc:/gui/main.qml")));
return app.exec();
}
开发者ID:matheus013,项目名称:Nutron,代码行数:14,代码来源:main.cpp
示例17: main
int main (int argc, char** argv)
{
Terminal t;
t.func();
auto bd = decor<BoldDecorator>(t); // smart way
bd.func();
BoldDecorator<Terminal>(t).func(); // ugly way
decor<BarEndlineDecorator>(bd).func(); // smart way
BarEndlineDecorator< BoldDecorator<Terminal> >(bd).func(); // ugly way
}
开发者ID:ppolcz,项目名称:workspace,代码行数:14,代码来源:decorator_template.cpp
示例18: draw
void Screen::draw(Terminal &terminal)
{
terminal.clear();
for(uint16_t y = 0; y < m_height; y++)
{
for(uint16_t x = 0; x < m_width; x++)
{
terminal.pushColor(m_color[y*m_width + x]);
std::cout << m_data[y*m_width + x];
terminal.popColor();
}
std::cout << "\n";
}
std::cout << std::flush;
}
开发者ID:GOlssn,项目名称:GameOfLife,代码行数:15,代码来源:screen.cpp
示例19: kernel_main
void kernel_main()
{
initDescriptorTables();
Terminal term;
term.clear();
initializePaging();
term.writeColoredString("$7Hello $FMaster$7, $4welcome $7home!\n");
asm volatile("sti");
initTimer(100);
term.writeDec(*(uint32_t*)0xABADF00D);
for (;;);
}
开发者ID:Jereq,项目名称:backspace,代码行数:17,代码来源:kernel.cpp
示例20: ReportEndOfGame
// NOTE: The following is called only when there is a
// checkmate, stalemate, or draw by attrition.
// The function is NOT called if a player resigns.
virtual void ReportEndOfGame(ChessSide winner)
{
switch (winner)
{
case SIDE_WHITE:
TheTerminal.printline("White wins.");
break;
case SIDE_BLACK:
TheTerminal.printline("Black wins.");
break;
case SIDE_NEITHER:
TheTerminal.printline("Draw game.");
break;
}
}
开发者ID:LiosanGOG,项目名称:chenard,代码行数:20,代码来源:ttychess.cpp
注:本文中的Terminal类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论