本文整理汇总了C++中IBattle::GetInGame方法的典型用法代码示例。如果您正苦于以下问题:C++ IBattle::GetInGame方法的具体用法?C++ IBattle::GetInGame怎么用?C++ IBattle::GetInGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBattle
的用法示例。
在下文中一共展示了IBattle::GetInGame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBattleStatus
wxString IconImageList::GetBattleStatus( const IBattle& battle ) const
{
unsigned idx = battle.GetInGame() << 3 | battle.IsLocked() << 2 | battle.IsFull() << 1 | battle.IsPassworded() << 0;
static const wxString states[16] = {
/* - */ _("Game is open."),
/* passworded */ _("Game is password-protected."),
/* full */ _("Game is full."),
/* full, passworded */ _("Game is full and password-protected."),
/* locked */ _("Game is closed."),
/* locked, passworded */ _("Game is closed and password-protected."),
/* locked, full */ _("Game is closed and full."),
/* locked, full, passworded */ _("Game is closed, full and password-protected."),
/* in game */ _("Game is in progress."),
/* in game, passworded */ _("Game is in progress and password-protected."),
/* in game, full */ _("Game is in progress and full."),
/* in game, full, passworded */ _("Game is in progress, full and password-protected."),
/* in game, locked */ _("Game is in progress and closed."),
/* in game, locked, passworded */ _("Game is in progress, closed and password-protected."),
/* in game, locked, full */ _("Game is in progress, closed and full."),
/* in game, locked, full, passworded */ _("Game is in progress, closed, full and password-protected."),
};
return states[idx];
// return _T("Game has unknown status");
}
示例2: GetBattleStatusIcon
int IconImageList::GetBattleStatusIcon( const IBattle& battle ) const
{
unsigned idx = battle.GetInGame() << 3 | battle.IsLocked() << 2 | battle.IsFull() << 1 | battle.IsPassworded() << 0;
static const int icons[16] = {
/* - */ ICON_OPEN_GAME,
/* passworded */ ICON_OPEN_PW_GAME,
/* full */ ICON_OPEN_FULL_GAME,
/* full, passworded */ ICON_OPEN_FULL_PW_GAME,
/* locked */ ICON_CLOSED_GAME,
/* locked, passworded */ ICON_CLOSED_PW_GAME,
/* locked, full */ ICON_CLOSED_FULL_GAME,
/* locked, full, passworded */ ICON_CLOSED_FULL_PW_GAME,
/* in game */ ICON_STARTED_GAME,
/* in game, passworded */ ICON_STARTED_GAME,
/* in game, full */ ICON_STARTED_GAME,
/* in game, full, passworded */ ICON_STARTED_GAME,
/* in game, locked */ ICON_STARTED_GAME_LOCKED,
/* in game, locked, passworded */ ICON_STARTED_GAME_LOCKED,
/* in game, locked, full */ ICON_STARTED_GAME_LOCKED,
/* in game, locked, full, passworded */ ICON_STARTED_GAME_LOCKED,
};
return icons[idx];
// return ICON_GAME_UNKNOWN;
}
示例3: FilterBattle
bool BattleListFilter::FilterBattle(IBattle& battle)
{
if (!m_activ)
return true;
if (m_filter_highlighted->IsChecked() |
m_filter_status_start->IsChecked() |
m_filter_status_locked->IsChecked() |
m_filter_status_pass->IsChecked() |
m_filter_status_full->IsChecked() |
m_filter_status_open->IsChecked()) {
bool bResult = false;
if (m_filter_highlighted->IsChecked()) {
try {
wxString host = TowxString(battle.GetFounder().GetNick());
bResult = useractions().DoActionOnUser(UserActions::ActHighlight, host);
if (!bResult)
for (unsigned int i = 0; i < battle.GetNumUsers(); ++i) {
wxString name = TowxString(battle.GetUser(i).GetNick());
if (useractions().DoActionOnUser(UserActions::ActHighlight, name)) {
bResult = true;
break;
}
}
} catch (...) {
}
}
//Battle Status Check
if (m_filter_status_start->GetValue())
bResult |= battle.GetInGame();
if (m_filter_status_locked->GetValue())
bResult |= battle.IsLocked();
if (m_filter_status_pass->GetValue())
bResult |= battle.IsPassworded();
if (m_filter_status_full->GetValue())
bResult |= battle.IsFull();
if (m_filter_status_open->GetValue())
bResult |= (!battle.IsPassworded() && !battle.IsLocked() && !battle.GetInGame() && !battle.IsFull());
if (bResult == false)
return false;
}
//Rank Check
/** @fixme Is `nonsenserank' useful, or can it be removed? Why is
* it here in the first place?
*/
/* `Nonsense', in this context, apparently means that the battle
* requires rank 100, exactly, AND we're filtering for values less
* than some number.
*/
bool nonsenserank = (m_filter_rank_mode == BUTTON_MODE_SMALLER) && (battle.GetRankNeeded() == 100);
if (m_filter_rank_choice_value != -1 /* don't have "all" selected */
&& !nonsenserank /* Nonsensical `nonsenserank' flag isn't set. */
&& !_IntCompare(battle.GetRankNeeded(), m_filter_rank_choice_value, m_filter_rank_mode))
return false;
//Player Check
if ((m_filter_player_choice_value != -1) && !_IntCompare(battle.GetNumUsers() - battle.GetSpectators(), m_filter_player_choice_value, m_filter_player_mode))
return false;
//MaxPlayer Check
if ((m_filter_maxplayer_choice_value != -1) && !_IntCompare(battle.GetMaxPlayers(), m_filter_maxplayer_choice_value, m_filter_maxplayer_mode))
return false;
//Spectator Check
if ((m_filter_spectator_choice_value != -1) && !_IntCompare(battle.GetSpectators(), m_filter_spectator_choice_value, m_filter_spectator_mode))
return false;
//Only Maps i have Check
if (m_filter_map_show->GetValue() && !battle.MapExists())
return false;
//Only Mods i have Check
if (m_filter_mod_show->GetValue() && !battle.GameExists())
return false;
//Strings Plain Text & RegEx Check (Case insensitiv)
//Description:
if (!StringMatches(TowxString(battle.GetDescription()),
m_filter_description_edit->GetValue(),
m_filter_description_expression))
return false;
//Host:
try { //!TODO
if (!StringMatches(TowxString(battle.GetFounder().GetNick()),
m_filter_host_edit->GetValue(),
m_filter_host_expression))
//.........这里部分代码省略.........