本文整理汇总了C++中Player::AILevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Player::AILevel方法的具体用法?C++ Player::AILevel怎么用?C++ Player::AILevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::AILevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
GroundAI::GroundAI(SimObject* s)
: ship((Ship*) s), target(0), subtarget(0), exec_time(0), carrier_ai(0)
{
Sim* sim = Sim::GetSim();
Ship* pship = sim->GetPlayerShip();
int player_team = 1;
int ai_level = 1;
if (pship)
player_team = pship->GetIFF();
Player* player = Player::GetCurrentPlayer();
if (player) {
if (ship && ship->GetIFF() && ship->GetIFF() != player_team) {
ai_level = player->AILevel();
}
else if (player->AILevel() == 0) {
ai_level = 1;
}
}
// evil alien ships are *always* smart:
if (ship && ship->GetIFF() > 1 && ship->Design()->auto_roll > 1) {
ai_level = 2;
}
if (ship && ship->GetHangar() && ship->GetCommandAILevel() > 0)
carrier_ai = new(__FILE__,__LINE__) CarrierAI(ship, ai_level);
}
示例2:
void
OptDlg::Show()
{
FormWindow::Show();
if (closed) {
Starshatter* stars = Starshatter::GetInstance();
if (stars) {
if (flight_model)
flight_model->SetSelection(Ship::GetFlightModel());
if (landings)
landings->SetSelection(Ship::GetLandingModel());
if (hud_mode)
hud_mode->SetSelection(HUDView::IsArcade() ? 1 : 0);
if (hud_color)
hud_color->SetSelection(HUDView::DefaultColorSet());
if (ff_mode)
ff_mode->SetSelection((int) (Ship::GetFriendlyFireLevel() * 4));
}
Player* player = Player::GetCurrentPlayer();
if (player) {
if (flying_start)
flying_start->SetSelection(player->FlyingStart());
if (ai_difficulty)
ai_difficulty->SetSelection(ai_difficulty->NumItems() - player->AILevel() - 1);
if (grid_mode)
grid_mode->SetSelection(player->GridMode());
if (gunsight)
gunsight->SetSelection(player->Gunsight());
}
}
if (vid_btn) vid_btn->SetButtonState(0);
if (aud_btn) aud_btn->SetButtonState(0);
if (ctl_btn) ctl_btn->SetButtonState(0);
if (opt_btn) opt_btn->SetButtonState(1);
if (mod_btn) mod_btn->SetButtonState(0);
closed = false;
}