本文整理汇总了C++中Mission类的典型用法代码示例。如果您正苦于以下问题:C++ Mission类的具体用法?C++ Mission怎么用?C++ Mission使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mission类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rMain
void
MessageReader::update(float)
{
Mission* mission = rMain()->getMission();
const MessageList& messages = mission->getMessages();
if(static_cast<int>(messages.size() + 1) == mMessageList->size()) return;
unsigned oldIndex = mMessageList->getSelected();
mMessageList->removeAllItems();
vector<wstring> headingLine;
headingLine.push_back(L"Date");
headingLine.push_back(L"From");
headingLine.push_back(L"Subject");
mMessageList->addItem(headingLine, false);
for(MessageList::const_iterator iMessage = messages.begin(); iMessage != messages.end(); ++iMessage) {
const Message& message = *iMessage;
vector<wstring> newLine;
// FIXME: Message times
// newLine.push_back(message.mTime.getSimulationDateString());
newLine.push_back(L"fix date");
newLine.push_back(message.mFrom);
newLine.push_back(message.mSubject);
mMessageList->addItem(newLine);
}
mMessageList->setSelected(oldIndex);
if(0 != oldIndex && (oldIndex - 1) < messages.size())
mMessagePane->setLabel(messages[oldIndex - 1].mBody);
else
mMessagePane->setLabel(L"");
}
示例2: mission_is_solvent
int
mission_is_solvent(LuaState* state)
{
Mission* mission = rMain()->getMission();
state->PushBoolean(mission->isSolvent());
return 1;
}
示例3: rMain
void
MissionSelector::startMission(unsigned num)
{
Entry missionEntry;
if(mCurrentCampaign == NULL) {
// FIXME: we should fall back to station school in case a first timer plays
missionEntry = mMissions[0];
}
else {
if(num < 0 || num >= static_cast<int>(mCurrentMissions.size())) return;
mMissionNum = num;
missionEntry = mCurrentMissions[num];
}
Mission* oldMission = rMain()->getMission();
Orbit* orbitScreen = static_cast<Orbit*>(rMain()->getScreenManager().getState(Main::ORBIT_SCREEN));
orbitScreen->enterReadyState();
DataFile* dataFile = new DataFile();
Mission* mission = new Mission(dataFile);
dataFile->setRootItem(mission);
rMain()->setMission(mission);
mission->initScriptFile(missionEntry.script);
if(oldMission != NULL) {
if (oldMission == ConfigManager::getPlayer()->getHomeBase()) {
ConfigManager::getSingleton().savePlayer();
}
else {
delete oldMission->getDataFile();
}
}
}
示例4: DYNLOG_ADDLOG
Mission* Player::AcceptMission(Mission* pMission)
{
if ( !pMission )
return NULL;
Mission* pMyMission = this->GetMission(pMission->GetID());;
if ( !pMyMission )
{
pMyMission = pMission->Clone();
if ( pMyMission )
{
m_missionLock.LockForWrite();
m_mapMissions[ pMyMission->GetID() ] = pMyMission;
pMyMission->SetComplete(false);
if ( pMyMission->GetParentID() != 0 )
{
MissionMap::iterator it = m_mapMissions.find( pMyMission->GetParentID() );
if ( it != m_mapMissions.end() )
{
it->second->AddChildMission(pMyMission);
}
else
{
DYNLOG_ADDLOG( DYNLOG_FORMAT("Player::AcceptMission(): Could not add mission id %ld as a child to mission %ld because parent does not exist in Player %ld object", pMyMission->GetID(), pMyMission->GetParentID(), m_id) );
}
}
m_missionLock.Unlock();
}
}
return pMyMission;
}
示例5: if
void
MsnSelectDlg::OnDel(AWEvent* event)
{
const char* cname = 0;
if (cmb_campaigns)
cname = cmb_campaigns->GetSelectedItem();
else if (lst_campaigns)
cname = lst_campaigns->GetSelectedItem();
Campaign* c = Campaign::SelectCampaign(cname);
if (!c) return;
Mission* m = c->GetMission(mission_id);
if (!m) return;
ConfirmDlg* confirm = manager->GetConfirmDlg();
if (confirm) {
char msg[256];
sprintf_s(msg, Game::GetText("MsnSelectDlg.are-you-sure").data(), m->Name());
confirm->SetMessage(msg);
confirm->SetTitle(Game::GetText("MsnSelectDlg.confirm-delete"));
confirm->SetParentControl(btn_del);
manager->ShowConfirmDlg();
}
else {
OnDelConfirm(event);
}
}
示例6: LOG
/*!
* Loads a mission.
* \param n Mission id.
* \return NULL if Mission could not be loaded.
*/
Mission *MissionManager::loadMission(int n)
{
LOG(Log::k_FLG_IO, "MissionManager", "loadMission()", ("loading mission %i", n));
char tmp[100];
int size;
sprintf(tmp, GAME_PATTERN, n);
uint8 *data = File::loadOriginalFile(tmp, size);
if (data == NULL) {
return NULL;
}
Mission *m = new Mission();
if (!m->loadLevel(data)) {
delete[] data;
delete m;
return NULL;
}
delete[] data;
Map *p_map = g_App.maps().loadMap(m->mapId());
if (p_map == NULL) {
delete m;
return NULL;
}
m->set_map(p_map);
return m;
}
示例7: mission_get_credits
int
mission_get_credits(LuaState* state)
{
Mission* mission = rMain()->getMission();
state->PushNumber(mission->getCredits());
return 1;
}
示例8: castingCallback_BASEVFF_Freefall
void castingCallback_BASEVFF_Freefall(Actor* parent)
{
Mission* mission = dynamic_cast<Mission*>( parent ); assert( mission );
// build forced equipment
Virtues::Equipment equipment = selectBASEEquipment(
mission->getScene()->getCareer(),
mission->getScene()->getLocation()->getWindAmbient(),
mission->getScene()->getLocation()->getWindBlast()
);
// exit point
Enclosure* exitPoint = parent->getScene()->getExitPointEnclosure( mission->getMissionInfo()->exitPointId );
// cast player on exit point
mission->setPlayer( new Jumper( mission, NULL, exitPoint, NULL, NULL, &equipment ) );
// setup brief signature for player
mission->getPlayer()->setSignatureType( stBrief );
// cast instructor
new instructor::BASEInstructor02( mission->getPlayer() );
new GoalStateOfHealth( mission->getPlayer() );
new GoalStateOfGear( mission->getPlayer() );
// play no music for this mission
Gameplay::iGameplay->stopSoundtrack();
}
示例9: IsSatisfied
// Check whether the NPC and waypoint conditions of the given mission have
// been satisfied.
bool MapPanel::IsSatisfied(const Mission &mission) const
{
for(const NPC &npc : mission.NPCs())
if(!npc.HasSucceeded(player.GetSystem()))
return false;
return mission.Waypoints().empty();
}
示例10: mission_credit_transaction
int
mission_credit_transaction(LuaState* state)
{
Mission* mission = rMain()->getMission();
LuaObject lCredits = state->Stack(1);
if(lCredits.IsNumber() == false) return 0;
float credits = lCredits.GetFloat();
mission->creditTransaction(credits);
return 0;
}
示例11: castingCallback_TrollField_JumpFromRun
void castingCallback_TrollField_JumpFromRun(Actor* parent)
{
Mission* mission = dynamic_cast<Mission*>( parent ); assert( mission );
// exit point
Enclosure* exitPoint = parent->getScene()->getExitPointEnclosure( mission->getMissionInfo()->exitPointId );
// cast player on exit point
mission->setPlayer( new Jumper( mission, NULL, exitPoint, NULL, NULL, NULL ) );
// setup full signature for player
mission->getPlayer()->setSignatureType( stFull );
// cast instructor
new instructor::JumpFromRunInstructor( mission->getPlayer() );
// cast goals
new GoalStateOfHealth( mission->getPlayer() );
new GoalStateOfGear( mission->getPlayer() );
new GoalLanding( mission->getPlayer() );
new GoalExperience( mission->getPlayer() );
// play original music for this mission
Gameplay::iGameplay->playSoundtrack( "./res/sounds/music/dirty_moleculas_action.ogg" );
}
示例12: GetUI
void SpaceportPanel::Step()
{
if(GetUI()->IsTop(this))
{
Mission *mission = player.MissionToOffer(Mission::SPACEPORT);
if(mission)
mission->Do(Mission::OFFER, player, GetUI());
else
player.HandleBlockedMissions(Mission::SPACEPORT, GetUI());
}
}
示例13: DrawMissionSystem
void MissionPanel::DrawMissionSystem(const Mission &mission, const Color &color) const
{
const Color &waypointColor = *GameData::Colors().Get("waypoint back");
Point pos = Zoom() * (mission.Destination()->GetSystem()->Position() + center);
RingShader::Draw(pos, 22., 20.5, color);
for(const System *system : mission.Waypoints())
RingShader::Draw(Zoom() * (system->Position() + center), 22., 20.5, waypointColor);
for(const Planet *planet : mission.Stopovers())
RingShader::Draw(Zoom() * (planet->GetSystem()->Position() + center), 22., 20.5, waypointColor);
}
示例14: message_post
int
message_post(LuaState* state)
{
wstring from = getWString(state, 1);
wstring subject = getWString(state, 2);
wstring body = getWString(state, 3);
Mission* mission = rMain()->getMission();
mission->postMessage(from, subject, body);
return 0;
}
示例15: Mission
Mission *MissionManager::loadMission(int n)
{
Mission *m = new Mission();
printf("loading mission %i\n", n);
char tmp[100];
switch(g_App.menus().currLanguage()) {
case MenuManager::ENGLISH:
sprintf(tmp, "miss%02d.dat", n);
break;
case MenuManager::FRENCH:
sprintf(tmp, "miss1%02d.dat", n);
break;
case MenuManager::ITALIAN:
sprintf(tmp, "miss2%02d.dat", n);
break;
case MenuManager::GERMAN:
sprintf(tmp, "miss3%02d.dat", n);
break;
}
int size;
uint8 *data = File::loadFile(tmp, size);
if (data == NULL) {
delete m;
return NULL;
}
if (!m->loadMission(data, size)) {
delete[] data;
delete m;
return NULL;
}
delete[] data;
sprintf(tmp, "game%02d.dat", n);
data = File::loadFile(tmp, size);
if (data == NULL) {
delete m;
return NULL;
}
if (!m->loadLevel(data)) {
delete[] data;
delete m;
return NULL;
}
delete[] data;
missions_[n] = m;
return m;
}