本文整理汇总了C++中cPlayer::GetGameMode方法的典型用法代码示例。如果您正苦于以下问题:C++ cPlayer::GetGameMode方法的具体用法?C++ cPlayer::GetGameMode怎么用?C++ cPlayer::GetGameMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cPlayer
的用法示例。
在下文中一共展示了cPlayer::GetGameMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clicked
void cSlotAreaInventoryBase::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem)
{
if ((a_Player.GetGameMode() == eGameMode_Creative) && (m_ParentWindow.GetWindowType() == cWindow::Inventory))
{
// Creative inventory must treat a_ClickedItem as a DraggedItem instead, replacing the inventory slot with it
SetSlot(a_SlotNum, a_Player, a_ClickedItem);
return;
}
// Survival inventory and all other windows' inventory has the same handling as normal slot areas
super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem);
return;
}
示例2: Lock
void cProtocol132::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_LOGIN);
WriteInt (a_Player.GetUniqueID()); // EntityID of the player
WriteString("default"); // Level type
WriteByte ((Byte)a_Player.GetGameMode());
WriteByte ((Byte)(a_World.GetDimension()));
WriteByte (2); // TODO: Difficulty
WriteByte (0); // Unused, used to be world height
WriteByte (8); // Client list width or something
Flush();
m_LastSentDimension = a_World.GetDimension();
SendCompass(a_World);
}
示例3: Lock
void cProtocol125::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
{
UNUSED(a_World);
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_LOGIN);
WriteInt (a_Player.GetUniqueID()); // EntityID of the player
WriteString(""); // Username, not used
WriteString("default"); // Level type
WriteInt ((int)a_Player.GetGameMode());
WriteInt ((int)(a_World.GetDimension()));
WriteByte (2); // TODO: Difficulty
WriteByte (0); // Unused
WriteByte (60); // Client list width or something
Flush();
}