本文整理汇总了C++中GetSlot函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSlot函数的具体用法?C++ GetSlot怎么用?C++ GetSlot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSlot函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetSlot
void Item::UpdateDuration(Player* owner, uint32 diff)
{
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
// DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
{
if (uint32 newItemId = sObjectMgr.GetItemExpireConvert(GetEntry()))
owner->ConvertItem(this, newItemId);
else
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
return;
}
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
SetState(ITEM_CHANGED, owner); // save new time in database
}
开发者ID:82cheyenne82,项目名称:MaNGOS-Core-4.3.4,代码行数:19,代码来源:Item.cpp
示例2: GetName
void ArenaTeam::DelMember(uint64 guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
if (Player *player = sObjectMgr->GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
sLog->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
}
开发者ID:Bes666,项目名称:sc406,代码行数:19,代码来源:ArenaTeam.cpp
示例3: Deactivate
bool CLatentEffect::Deactivate()
{
if (IsActivated())
{
//remove the modifier from weapon, not player
if (GetModValue() == Mod::ADDITIONAL_EFFECT || GetModValue() == Mod::DMG)
{
CCharEntity* PChar = (CCharEntity*)m_POwner;
CItemWeapon* weapon = (CItemWeapon*)PChar->getEquip((SLOTTYPE)GetSlot());
int16 modPower = GetModPower();
if (weapon != nullptr && (weapon->isType(ITEM_ARMOR) || weapon->isType(ITEM_WEAPON)))
{
if (GetModValue() == Mod::ADDITIONAL_EFFECT)
{
for (uint8 i = 0; i < weapon->modList.size(); ++i)
{
//ensure the additional effect is fully removed from the weapon
if (weapon->modList.at(i).getModID() == Mod::ADDITIONAL_EFFECT)
{
weapon->modList.at(i).setModAmount(0);
}
}
}
else
{
weapon->addModifier(CModifier(GetModValue(), -modPower));
}
}
}
else
{
m_POwner->delModifier(m_ModValue, m_ModPower);
}
m_Activated = false;
//printf("LATENT DEACTIVATED: %d\n", m_ModValue);
return true;
}
return false;
}
开发者ID:DerpStarProject,项目名称:darkstar,代码行数:43,代码来源:latent_effect.cpp
示例4: defined
void Item::UpdateDuration(Player* owner, uint32 diff)
{
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
#endif
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
{
sScriptMgr->OnItemExpire(owner, GetTemplate());
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
return;
}
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
SetState(ITEM_CHANGED, owner); // save new time in database
}
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:19,代码来源:Item.cpp
示例5: GetId
void ArenaTeam::SaveToDB()
{
// Save team and member stats to db
// Called after a match has ended or when calculating arena_points
SQLTransaction trans = CharacterDatabase.BeginTransaction();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_STATS);
stmt->setUInt16(0, Stats.Rating);
stmt->setUInt16(1, Stats.WeekGames);
stmt->setUInt16(2, Stats.WeekWins);
stmt->setUInt16(3, Stats.SeasonGames);
stmt->setUInt16(4, Stats.SeasonWins);
stmt->setUInt32(5, Stats.Rank);
stmt->setUInt32(6, GetId());
trans->Append(stmt);
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
// Save the effort and go
if (itr->WeekGames == 0)
continue;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER);
stmt->setUInt16(0, itr->PersonalRating);
stmt->setUInt16(1, itr->WeekGames);
stmt->setUInt16(2, itr->WeekWins);
stmt->setUInt16(3, itr->SeasonGames);
stmt->setUInt16(4, itr->SeasonWins);
stmt->setUInt32(5, GetId());
stmt->setUInt32(6, itr->Guid.GetCounter());
trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHARACTER_ARENA_STATS);
stmt->setUInt32(0, itr->Guid.GetCounter());
stmt->setUInt8(1, GetSlot());
stmt->setUInt16(2, itr->MatchMakerRating);
trans->Append(stmt);
}
CharacterDatabase.CommitTransaction(trans);
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:42,代码来源:ArenaTeam.cpp
示例6: ItemInHotbar
void cSlotArea::NumberClicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction)
{
if ((a_ClickAction < caNumber1) || (a_ClickAction > caNumber9))
{
return;
}
int HotbarSlot = (int)a_ClickAction - (int)caNumber1;
cItem ItemInHotbar(a_Player.GetInventory().GetHotbarSlot(HotbarSlot));
cItem ItemInSlot(*GetSlot(a_SlotNum, a_Player));
// The items are equal. Do nothing.
if (ItemInHotbar.IsEqual(ItemInSlot))
{
return;
}
a_Player.GetInventory().SetHotbarSlot(HotbarSlot, ItemInSlot);
SetSlot(a_SlotNum, a_Player, ItemInHotbar);
}
开发者ID:TonyMo,项目名称:MCServer,代码行数:20,代码来源:SlotArea.cpp
示例7: Validate
VOID
CSDHCBase::PowerUp(
)
{
Validate();
for (DWORD dwSlot = 0; dwSlot < m_cSlots; ++dwSlot) {
PCSDHCSlotBase pSlot = GetSlot(dwSlot);
CEDEVICE_POWER_STATE cpsRequired = pSlot->GetPowerUpRequirement();
if (cpsRequired < m_cpsCurrent) {
// Move controller to higher power state initially since
// it will need to be powered for the slot to access
// registers.
SetControllerPowerState(cpsRequired);
}
pSlot->PowerUp();
}
}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:20,代码来源:sdhc.cpp
示例8: GetSlot
void cSlotAreaEnchanting::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_Apply, bool a_KeepEmptySlots)
{
const cItem * Slot = GetSlot(0, a_Player);
if (!Slot->IsEmpty())
{
return;
}
if (a_Apply)
{
SetSlot(0, a_Player, a_ItemStack.CopyOne());
}
a_ItemStack.m_ItemCount -= 1;
if (a_ItemStack.m_ItemCount <= 0)
{
a_ItemStack.Empty();
}
UpdateResult(a_Player);
}
开发者ID:MuhammadWang,项目名称:MCServer,代码行数:20,代码来源:SlotArea.cpp
示例9: GhostRecorder
void CGhost::StopRecord(int Time)
{
m_Recording = false;
bool RecordingToFile = GhostRecorder()->IsRecording();
if(RecordingToFile)
GhostRecorder()->Stop(m_CurGhost.m_Path.Size(), Time);
CMenus::CGhostItem *pOwnGhost = m_pClient->m_pMenus->GetOwnGhost();
if(Time > 0 && (!pOwnGhost || Time < pOwnGhost->m_Time))
{
if(pOwnGhost && pOwnGhost->Active())
Unload(pOwnGhost->m_Slot);
// add to active ghosts
int Slot = GetSlot();
if(Slot != -1)
m_aActiveGhosts[Slot] = std::move(m_CurGhost);
// create ghost item
CMenus::CGhostItem Item;
if(RecordingToFile)
GetPath(Item.m_aFilename, sizeof(Item.m_aFilename), m_CurGhost.m_aPlayer, Time);
str_copy(Item.m_aPlayer, m_CurGhost.m_aPlayer, sizeof(Item.m_aPlayer));
Item.m_Time = Time;
Item.m_Slot = Slot;
// save new ghost file
if(Item.HasFile())
Storage()->RenameFile(m_aTmpFilename, Item.m_aFilename, IStorage::TYPE_SAVE);
// add item to menu list
m_pClient->m_pMenus->UpdateOwnGhost(Item);
}
else if(RecordingToFile) // no new record
Storage()->RemoveFile(m_aTmpFilename, IStorage::TYPE_SAVE);
m_aTmpFilename[0] = 0;
m_CurGhost.Reset();
}
开发者ID:Laxa,项目名称:ddnet,代码行数:41,代码来源:ghost.cpp
示例10: Item
void Item::UpdateDuration(Player* owner, uint32 diff)
{
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
sLog.outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
uint32 itemId = this->GetEntry();
Script->ItemExpire(owner, GetProto());
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
ItemPosCountVec dest;
if (itemId == 39878) //Mysterious Egg
{
uint8 msg = owner->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1);
if (msg == EQUIP_ERR_OK)
{
Item* item = owner->StoreNewItem(dest,39883,true);
if (item)
owner->SendNewItem(item,1,false,true);
}
}
if (itemId == 44717) //Disgusting Jar
{
uint8 msg = owner->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1);
if (msg == EQUIP_ERR_OK)
{
Item* item = owner->StoreNewItem(dest,44718,true);
if (item)
owner->SendNewItem(item,1,false,true);
}
}
return;
}
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
SetState(ITEM_CHANGED, owner); // save new time in database
}
开发者ID:Sanzzes,项目名称:wopc-core,代码行数:41,代码来源:Item.cpp
示例11: GetSlot
// New function to Card detect thread of HSMMC ch1 on SMDK6410.
DWORD CSDHControllerCh1::CardDetectThread() {
BOOL bSlotStateChanged = FALSE;
DWORD dwWaitResult = WAIT_TIMEOUT;
PCSDHCSlotBase pSlotZero = GetSlot(0);
CeSetThreadPriority(GetCurrentThread(), 100);
while(1) {
// Wait for the next insertion/removal interrupt
dwWaitResult = WaitForSingleObject(m_hevCardDetectEvent, INFINITE);
Lock();
pSlotZero->HandleInterrupt(SDSLOT_INT_CARD_DETECTED);
Unlock();
InterruptDone(m_dwSDDetectSysIntr);
EnableCardDetectInterrupt();
}
return TRUE;
}
开发者ID:HITEG,项目名称:TenByTen6410_SLC,代码行数:22,代码来源:s3c6410_hsmmc.cpp
示例12: Activate
void CLatentEffect::Activate()
{
if( !IsActivated() )
{
//additional effect/dmg latents add mod to weapon, not player
if (GetModValue() == MOD_ADDITIONAL_EFFECT || GetModValue() == MOD_DMG)
{
CCharEntity* PChar = (CCharEntity*)m_POwner;
CItemWeapon* weapon = (CItemWeapon*)PChar->getEquip((SLOTTYPE)GetSlot());
weapon->addModifier(new CModifier(GetModValue(), GetModPower()));
}
else
{
m_POwner->addModifier(m_ModValue, m_ModPower);
}
m_Activated = true;
//printf("LATENT ACTIVATED: %d, Current value: %d\n", m_ModValue, m_POwner->getMod(m_ModValue));
}
}
开发者ID:maxtherabbit,项目名称:darkstar,代码行数:21,代码来源:latent_effect.cpp
示例13: GetSlot
void Item::UpdateDuration(Player* owner, uint32 diff)
{
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
//DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
return;
}
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
SetState(ITEM_CHANGED, owner); // save new time in database
//Remove refundable flag for next time if item is no logner refundable
if(HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE))
if(!GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) || (GetOwner() && GetOwner()->m_Played_time[0] > (GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + 2*60*60)))
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
}
开发者ID:Nny,项目名称:Core,代码行数:21,代码来源:Item.cpp
示例14: GetName
void ArenaTeam::DelMember(ObjectGuid guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
}
if(Player *player = sObjectMgr.GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for(int i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), guid.GetCounter());
}
开发者ID:Archives,项目名称:easy-mangos,代码行数:21,代码来源:ArenaTeam.cpp
示例15: GetName
void ArenaTeam::DelMember(uint64 guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
}
if(Player *player = objmgr.GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for(int i = 0; i < ARENA_TEAM_END; ++i)
player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + i, 0);
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
}
开发者ID:1thew,项目名称:mangos,代码行数:21,代码来源:ArenaTeam.cpp
示例16: SetSlot
void CInventoryItem::load(IReader &packet)
{
m_eItemPlace = (EItemPlace)packet.r_u8();
m_fCondition = packet.r_float();
SetSlot (packet.r_u8());
if (GetSlot() == 255)
SetSlot (NO_ACTIVE_SLOT);
u8 tmp = packet.r_u8();
if (!tmp)
return;
if (!object().PPhysicsShell()) {
object().setup_physic_shell ();
object().PPhysicsShell()->Disable();
}
object().PHLoadState(packet);
object().PPhysicsShell()->Disable();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:21,代码来源:inventory_item.cpp
示例17: GetRatingMod
void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
// Called for offline player after ending rated arena match!
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
if (itr->Guid == guid)
{
// update personal rating
int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false);
itr->ModifyPersonalRating(NULL, mod, GetType());
// update matchmaker rating
itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());
// update personal played stats
itr->WeekGames += 1;
itr->SeasonGames += 1;
return;
}
}
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:21,代码来源:ArenaTeam.cpp
示例18: Result
void cSlotAreaCrafting::ShiftClickedResult(cPlayer & a_Player)
{
cItem Result(*GetSlot(0, a_Player));
if (Result.IsEmpty())
{
return;
}
cItem * PlayerSlots = GetPlayerSlots(a_Player) + 1;
for (;;)
{
// Try distributing the result. If it fails, bail out:
cItem ResultCopy(Result);
m_ParentWindow.DistributeStack(ResultCopy, a_Player, this, false);
if (!ResultCopy.IsEmpty())
{
// Couldn't distribute all of it. Bail out
return;
}
// Distribute the result, this time for real:
ResultCopy = Result;
m_ParentWindow.DistributeStack(ResultCopy, a_Player, this, true);
// Remove the ingredients from the crafting grid and update the recipe:
cCraftingRecipe & Recipe = GetRecipeForPlayer(a_Player);
cCraftingGrid Grid(PlayerSlots, m_GridSize, m_GridSize);
Recipe.ConsumeIngredients(Grid);
Grid.CopyToItems(PlayerSlots);
UpdateRecipe(a_Player);
// Broadcast the window, we sometimes move items to different locations than Vanilla, causing needless desyncs:
m_ParentWindow.BroadcastWholeWindow();
// If the recipe has changed, bail out:
if (!Recipe.GetResult().IsEqual(Result))
{
return;
}
}
}
开发者ID:RedEnraged96,项目名称:MCServer-1,代码行数:40,代码来源:SlotArea.cpp
示例19: UNUSED
int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int a_EndSlotNum, bool a_ConsiderEmptySlots)
{
UNUSED(a_ConsiderEmptySlots);
if ((a_BeginSlotNum < 0) || (a_BeginSlotNum >= invNumSlots))
{
LOGWARNING("%s: Bad BeginSlotNum, got %d, there are %d slots; correcting to 0.", __FUNCTION__, a_BeginSlotNum, invNumSlots - 1);
a_BeginSlotNum = 0;
}
if ((a_EndSlotNum < 0) || (a_EndSlotNum >= invNumSlots))
{
LOGWARNING("%s: Bad EndSlotNum, got %d, there are %d slots; correcting to %d.", __FUNCTION__, a_BeginSlotNum, invNumSlots, invNumSlots - 1);
a_EndSlotNum = invNumSlots - 1;
}
if (a_BeginSlotNum > a_EndSlotNum)
{
std::swap(a_BeginSlotNum, a_EndSlotNum);
}
char NumLeft = a_ItemStack.m_ItemCount;
int MaxStack = ItemHandler(a_ItemStack.m_ItemType)->GetMaxStackSize();
for (int i = a_BeginSlotNum; i <= a_EndSlotNum; i++)
{
const cItem & Slot = GetSlot(i);
if (Slot.IsEmpty())
{
NumLeft -= MaxStack;
}
else if (Slot.IsEqual(a_ItemStack))
{
NumLeft -= MaxStack - Slot.m_ItemCount;
}
if (NumLeft <= 0)
{
// All items fit
return a_ItemStack.m_ItemCount;
}
} // for i - m_Slots[]
return a_ItemStack.m_ItemCount - NumLeft;
}
开发者ID:36451,项目名称:MCServer,代码行数:40,代码来源:Inventory.cpp
示例20: ToDistribute
void cWindow::OnRightPaintEnd(cPlayer & a_Player)
{
// Process the entire action stored in the internal structures for inventory painting
// distribute one item into each slot
const cSlotNums & SlotNums = a_Player.GetInventoryPaintSlots();
cItem ToDistribute(a_Player.GetDraggingItem());
int NumDistributed = DistributeItemToSlots(a_Player, ToDistribute, 1, SlotNums);
// Remove the items distributed from the dragging item:
a_Player.GetDraggingItem().m_ItemCount -= NumDistributed;
if (a_Player.GetDraggingItem().m_ItemCount == 0)
{
a_Player.GetDraggingItem().Empty();
}
SendWholeWindow(*a_Player.GetClientHandle());
// To fix #2345 (custom recipes don't work when inventory-painting), we send the result slot explicitly once again
// This is a fix for what seems like a client-side bug
a_Player.GetClientHandle()->SendInventorySlot(m_WindowID, 0, *GetSlot(a_Player, 0));
}
开发者ID:UltraCoderRU,项目名称:MCServer,代码行数:23,代码来源:Window.cpp
注:本文中的GetSlot函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论