本文整理汇总了C++中BStringVector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ BStringVector::push_back方法的具体用法?C++ BStringVector::push_back怎么用?C++ BStringVector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BStringVector
的用法示例。
在下文中一共展示了BStringVector::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNewDiagnoseListBox
//======================================================================================================================
void UIManager::createNewDiagnoseListBox(UICallback* callback,PlayerObject* Medic, PlayerObject* Patient)
{
BStringVector attributesMenu;
BString FirstName = Patient->getFirstName(); FirstName.toUpper();
BString LastName = Patient->getLastName(); LastName.toUpper();
int8 title[64];
sprintf(title,"PATIENT %s %s'S WOUNDS",FirstName.getAnsi(), LastName.getAnsi());
int8 desc[512];
sprintf(desc, "Below is a listing of the Wound and Battle Fatigue levels of %s %s. Wounds are healed through /tendWound or use of Wound Medpacks. High levels of Battle Fatigue can inhibit the healing process, and Battle Fatigue can only be healed by the patient choosing to watch performing entertainers",Patient->getFirstName().getAnsi(), Patient->getLastName().getAnsi());
int8 Health[32];
sprintf(Health,"Health -- %i",Patient->getHam()->mHealth.getWounds());
attributesMenu.push_back(Health);
int8 Strength[32];
sprintf(Strength,"Strength -- %i",Patient->getHam()->mStrength.getWounds());
attributesMenu.push_back(Strength);
int8 Constitution[32];
sprintf(Constitution,"Constitution -- %i",Patient->getHam()->mConstitution.getWounds());
attributesMenu.push_back(Constitution);
int8 Action[32];
sprintf(Action,"Action -- %i",Patient->getHam()->mAction.getWounds());
attributesMenu.push_back(Action);
int8 Quickness[32];
sprintf(Quickness,"Quickness -- %i",Patient->getHam()->mQuickness.getWounds());
attributesMenu.push_back(Quickness);
int8 Stamina[32];
sprintf(Stamina,"Stamina -- %i",Patient->getHam()->mStamina.getWounds());
attributesMenu.push_back(Stamina);
int8 Mind[32];
sprintf(Mind,"Mind -- %i",Patient->getHam()->mMind.getWounds());
attributesMenu.push_back(Mind);
int8 Focus[32];
sprintf(Focus,"Focus -- %i",Patient->getHam()->mFocus.getWounds());
attributesMenu.push_back(Focus);
int8 Willpower[32];
sprintf(Willpower,"Willpower -- %i",Patient->getHam()->mWillpower.getWounds());
attributesMenu.push_back(Willpower);
int8 BattleFatigue[32];
sprintf(BattleFatigue,"Battle Fatigue -- %i",Patient->getHam()->getBattleFatigue());
attributesMenu.push_back(BattleFatigue);
createNewListBox(callback,"handleDiagnoseMenu",title, desc, attributesMenu, Medic, SUI_Window_ListBox,SUI_LB_OK,Patient->getId());
}
示例2: _processIsmGroupLootMasterResponse
void GroupManager::_processIsmGroupLootMasterResponse(Message* message)
{
gLogger->logMsg("_processIsmGroupLootMasterResponse");
PlayerObject* playerObject = gWorldManager->getPlayerByAccId(message->getUint32()); // the player whos group_id has changed
if(playerObject == NULL)
{
gLogger->logMsg("GroupManager::_processIsmGroupLootMasterResponse PlayerAccId not found");
return;
}
//send the SUI
gLogger->logMsg("ok\n");
PlayerList inRangeMembers = playerObject->getInRangeGroupMembers(true);
PlayerList::iterator it = inRangeMembers.begin();
BStringVector namesArray;
while(it != inRangeMembers.end())
{
namesArray.push_back((*it)->getFirstName().getAnsi());
++it;
}
gUIManager->createNewPlayerSelectListBox(playerObject,"handleSetLootMaster","@group:master_looter_sui_title","@group:set_loot_type_text",namesArray,inRangeMembers,playerObject);
}
示例3: _createTicketSelectMenu
void TicketCollector::_createTicketSelectMenu(PlayerObject* playerObject)
{
BStringVector availableTickets;
uint32 zoneId = gWorldManager->getZoneId();
ObjectIDList* invObjects = dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory))->getObjects();
ObjectIDList::iterator it = invObjects->begin();
while(it != invObjects->end())
{
if(TravelTicket* ticket = dynamic_cast<TravelTicket*>(gWorldManager->getObjectById((*it))))
{
BString srcPoint = (int8*)((ticket->getAttribute<std::string>("travel_departure_point")).c_str());
uint16 srcPlanetId = static_cast<uint16>(gWorldManager->getPlanetIdByName((int8*)((ticket->getAttribute<std::string>("travel_departure_planet")).c_str())));
if(srcPlanetId == zoneId && strcmp(srcPoint.getAnsi(),mPortDescriptor.getAnsi()) == 0)
{
BString dstPoint = (int8*)((ticket->getAttribute<std::string>("travel_arrival_point")).c_str());
availableTickets.push_back(dstPoint.getAnsi());
}
}
++it;
}
gUIManager->createNewListBox(this,"handleticketselect","select destination","Select destination",availableTickets,playerObject);
}
示例4: int
bool ArtisanManager::setupSampleEvent(PlayerObject* player, CurrentResource* resource, SurveyTool* tool)
{
//EVENT WINDOW CASE
int32 eventRoll = int(gRandom->getRand()%2)+1;
//eventRoll = 2;
//do event 1 or event 2 based on roll
if(eventRoll == 1)
{
// setup gamble event
//GAMBLE Event
WindowAsyncContainerCommand* asyncContainer = new WindowAsyncContainerCommand(Window_Query_Radioactive_Sample);
asyncContainer->PlayerId = player->getId();
asyncContainer->ToolId = tool->getId();
asyncContainer->CurrentResource = resource;
BStringVector items;
items.push_back("Ignore the concentration and continue working.");
items.push_back("Attempt to recover the resources. (300 Action)");
gUIManager->createNewListBox(this,"gambleSample","@survey:gnode_t","@survey:gnode_d",items,player,SUI_Window_SmplGamble_ListBox,SUI_LB_OKCANCEL,0,0,asyncContainer);
player->getSampleData()->mPendingSample = false;
return true;
}
else
{
WindowAsyncContainerCommand* asyncContainer = new WindowAsyncContainerCommand(Window_Query_Radioactive_Sample);
asyncContainer->PlayerId = player->getId();
asyncContainer->ToolId = tool->getId();
asyncContainer->CurrentResource = resource;
//WAYP CONCENTRATION
BStringVector items;
items.push_back("Ignore the concentration and continue working.");
items.push_back("Focus the device on the concentration");
gUIManager->createNewListBox(this,"waypNodeSample","@survey:cnode_t","@survey:cnode_d",items,player,SUI_Window_SmplWaypNode_ListBox,SUI_LB_OKCANCEL,0,0,asyncContainer);
//Pause sampling
player->getSampleData()->mPendingSample = false;
player->getSampleData()->mSampleEventFlag = true;
return true;
}
return false;
}
示例5: _processIsmGroupLootModeResponse
void GroupManager::_processIsmGroupLootModeResponse(Message* message)
{
gLogger->logMsg("_processIsmGroupLootModeResponse");
PlayerObject* playerObject = gWorldManager->getPlayerByAccId(message->getUint32()); // the player whos group_id has changed
if(playerObject == NULL)
{
gLogger->logMsg("GroupManager::processIsmGroupLootModeResponse PlayerAccId not found");
return;
}
//send the SUI
BStringVector availableLootModes;
availableLootModes.push_back("Free for all");
availableLootModes.push_back("Master Looter");
availableLootModes.push_back("Lottery");
availableLootModes.push_back("Random");
gUIManager->createNewListBox(playerObject,"handleSetLootMode","@group:set_loot_type_title","@group:set_loot_type_text",availableLootModes,playerObject,SUI_Window_SelectGroupLootMode_Listbox);
}
示例6: preProcessfilterConversation
bool Trainer::preProcessfilterConversation(ActiveConversation* av,Conversation* conversation,PlayerObject* player)
{
bool continueConversation = true;
ConversationPage *page = conversation->getPage(2); // Page 2 is where WE have the interesting skill-options to check.
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: page->mId = %u",page->mId);
setLastConversationTarget(player->getId());
std::vector<ConversationOption*>::iterator optionIt = page->mOptions.begin();
switch(page->mId)
{
// Lets see if we have the requriments met by this trainer.
case 2:
{
bool noviceSkill = false;
bool gotAllSkills = true; // As long as we have not detected any missing skills.
uint32 skillsToLearn = 0;
BStringVector skillsRequired;
bool gotRequirementsForSomeSkill = false;
while (optionIt != page->mOptions.end())
{
Skill* skill = gSkillManager->getSkillByName((*optionIt)->mStfVariable);
// requirementsMet = false;
// its no skill option
if (!skill)
{
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: Its no skill option");
}
// see if we have it already and check xp
// Note: We do not handle lack of SP as an error now... that's done later in this chain of events.
else if (player->checkSkill(skill->mId))
{
// We already have this skill.
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: We already have this skill");
}
else if (!skill->mSkillsRequired.size())
{
// No skill requirements, we got a "Novice" skill from a basic profession.
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: Novice");
skillsToLearn++;
gotAllSkills = false; // Do not have all skills if we end up here.
noviceSkill = true;
}
else
{
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: Do not have all skills if we end up here");
gotAllSkills = false; // Do not have all skills if we end up here.
// see if we got the required skills
SkillsRequiredList::iterator reqSkillIt = skill->mSkillsRequired.begin();
bool requirementsMet = true;
skillsToLearn++;
int8 str[128];
while (reqSkillIt != skill->mSkillsRequired.end())
{
if (!player->checkSkill(*reqSkillIt))
{
// we don't have the requirements
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: We don't have the requirements");
requirementsMet = false;
// We should only add requirements for Novice skills (and then only for Elite Professions).
if (strstr(gSkillManager->getSkillById(skill->mId)->mName.getAnsi(),"novice"))
{
// add it to our list
sprintf(str,"@%s:%s","skl_n", gSkillManager->getSkillById(*reqSkillIt)->mName.getAnsi());
// gLogger->log(LogManager::DEBUG,"Trainer::conversationEvent: Skills missing = %u %s", *reqSkillIt, gSkillManager->getSkillById(*reqSkillIt)->mName.getAnsi());
skillsRequired.push_back(str);
}
else
{
break;
}
}
++reqSkillIt;
}
if (requirementsMet)
{
// gLogger->log(LogManager::DEBUG,"Trainer::preProcessfilterConversation: We DO have the requirements, check if we have the xp for next level");
gotRequirementsForSomeSkill = true;
// We DO have the requirements, check if we have the xp for next level.
if (player->getXpAmount(skill->mXpType) < skill->mXpCost)
{
// We do not have enough of XP for training this skill.
// gLogger->log(LogManager::DEBUG,"Trainer::conversationEvent: Missing XP");
skillsToLearn--;
}
}
else
{
//.........这里部分代码省略.........
示例7: handleConversationEvent
//.........这里部分代码省略.........
break;
}
++reqSkillIt;
}
}
if (!failed)
{
// We do not charge any cost for training in the Tutorial.
}
else
{
// This is a system error.
gMessageLib->SendSystemMessage(::common::OutOfBand("teaching", "learning_failed"), player);
// gLogger->log(LogManager::DEBUG,"Trainer::conversationEvent: Error verifying credits");
pageLink = 0;
}
}
break;
case 7:
{
// Selected more info about this skill.
Skill* skill = gSkillManager->getSkillByName(av->getTOStfVariable());
if (skill)
{
int8 str[800];
BStringVector populatedListBox;
int8 strCaption[128];
sprintf(strCaption,"@%s:%s","skl_n", skill->mName.getAnsi());
sprintf(str,"MONETARY COST");
populatedListBox.push_back(str);
if (gWorldConfig->isTutorial() && (!skill->mSkillsRequired.size()))
{
sprintf(str,"%u credits", 0);
}
else
{
sprintf(str,"%u credits", skill->mMoneyRequired);
}
populatedListBox.push_back(str);
sprintf(str,"SKILL POINT COST");
populatedListBox.push_back(str);
sprintf(str,"%u points", skill->mSkillPointsRequired);
populatedListBox.push_back(str);
sprintf(str,"REQUIRED SKILLS");
populatedListBox.push_back(str);
SkillsRequiredList::iterator reqSkillIt = skill->mSkillsRequired.begin();
while (reqSkillIt != skill->mSkillsRequired.end())
{
// Add all skills required.
// if (!player->checkSkill(*reqSkillIt))
{
// We don't have this required skill
sprintf(str,"@%s:%s","skl_n", gSkillManager->getSkillById(*reqSkillIt)->mName.getAnsi());
populatedListBox.push_back(str);
}
++reqSkillIt;
}
示例8: die
//.........这里部分代码省略.........
while (buildingIt != inRangeBuildings.end())
{
BuildingObject* building = dynamic_cast<BuildingObject*>(*buildingIt);
if (building)
{
// Do we have any personal clone location?
if (building->getId() == player->getPreDesignatedCloningFacilityId())
{
// gLogger->logMsg("Found a pre-designated cloning facility");
preDesignatedBuilding = building;
}
if (building->getBuildingFamily() == BuildingFamily_Cloning_Facility)
{
// gLogger->logMsg("Found a cloning facility");
// TODO: This code is not working as intended if player dies inside, since buildings use world coordinates and players inside have cell coordinates.
// Tranformation is needed before the correct distance can be calculated.
if(!nearestBuilding ||
(nearestBuilding != building && (glm::distance(mPosition, building->mPosition) < glm::distance(mPosition, nearestBuilding->mPosition))))
{
nearestBuilding = building;
}
}
}
++buildingIt;
}
if (nearestBuilding)
{
if (nearestBuilding->getSpawnPoints()->size())
{
// buildingNames.push_back(nearestBuilding->getRandomSpawnPoint()->mName.getAnsi());
// buildingNames.push_back("Closest Cloning Facility");
buildingNames.push_back("@base_player:revive_closest");
buildings.push_back(nearestBuilding);
// Save nearest building in case we need to clone when reviev times out.
player->saveNearestCloningFacility(nearestBuilding);
}
}
if (preDesignatedBuilding)
{
if (preDesignatedBuilding->getSpawnPoints()->size())
{
// buildingNames.push_back("Pre-Designated Facility");
buildingNames.push_back("@base_player:revive_bind");
buildings.push_back(preDesignatedBuilding);
}
}
if (buildings.size())
{
// Set up revive timer in case of user don't clone.
gWorldManager->addPlayerObjectForTimedCloning(player->getId(), 10 * 60 * 1000); // TODO: Don't use hardcoded value.
gUIManager->createNewCloneSelectListBox(player,"cloneSelect","Select Clone Destination","Select clone destination",buildingNames,buildings,player);
}
else
{
gLogger->logMsg("No cloning facility available\n");
}
}
else // if(CreatureObject* creature = dynamic_cast<CreatureObject*>(this))
{
// gMessageLib->sendUpdateMovementProperties(player);
// gMessageLib->sendSelfPostureUpdate(player);