當前位置: 首頁>>代碼示例>>C#>>正文


C# GameObject.CanInteractWith方法代碼示例

本文整理匯總了C#中WCell.RealmServer.Entities.GameObject.CanInteractWith方法的典型用法代碼示例。如果您正苦於以下問題:C# GameObject.CanInteractWith方法的具體用法?C# GameObject.CanInteractWith怎麽用?C# GameObject.CanInteractWith使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.RealmServer.Entities.GameObject的用法示例。


在下文中一共展示了GameObject.CanInteractWith方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: WithdrawMoney

		public void WithdrawMoney(Character withdrawer, GameObject bank, uint withdrawl)
		{
			if (withdrawl == 0) return;
			if (!bank.CanInteractWith(withdrawer)) return;
			if (withdrawer.Guild == null || withdrawer.GuildMember == null) return;
			if (withdrawer.Guild != Guild) return;
			if (Guild.Money < withdrawl) return;

			var member = withdrawer.GuildMember;
			if (!member.HasRight(GuildPrivileges.WITHDRAW_GOLD) ||
				member.HasRight(GuildPrivileges.WITHDRAW_GOLD_LOCK))
			{
				return;
			}
			if (member.BankMoneyWithdrawlAllowance < withdrawl)
			{
				return;
			}

			Guild.Money -= withdrawl;
			withdrawer.Money += withdrawl;
			member.BankMoneyWithdrawlAllowance -= withdrawl;

			BankLog.LogEvent(GuildBankLogEntryType.WithdrawMoney, withdrawer, withdrawl, null, 0, null);

			GuildHandler.SendMemberRemainingDailyWithdrawlAllowance(withdrawer, member.BankMoneyWithdrawlAllowance);
			GuildHandler.SendGuildBankTabNames(withdrawer, bank);
			GuildHandler.SendGuildBankTabContents(withdrawer, bank, 0);
			GuildHandler.SendGuildBankMoneyUpdate(withdrawer, bank);
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:30,代碼來源:GuildBank.cs

示例2: DepositMoney

		public void DepositMoney(Character depositer, GameObject bank, uint deposit)
		{
			if (deposit == 0) return;
			if (!bank.CanInteractWith(depositer)) return;
			if (depositer.Guild == null || depositer.GuildMember == null) return;
			if (depositer.Guild != Guild) return;
			if (depositer.Money < deposit) return;

			Guild.Money += deposit;
			depositer.Money -= deposit;

			BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
			GuildHandler.SendGuildBankTabNames(depositer, bank);
			GuildHandler.SendGuildBankTabContents(depositer, bank, 0);
			GuildHandler.SendGuildBankMoneyUpdate(depositer, bank);
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:16,代碼來源:GuildBank.cs

示例3: DoBankChecks

		private bool DoBankChecks(Character chr, GameObject bank)
		{
			if (chr == null) return false;
			if (bank == null) return false;
			if (!bank.CanInteractWith(chr)) return false;

			return true;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:8,代碼來源:GuildBank.cs

示例4: GetBankTabContent

		public static void GetBankTabContent(Character chr, GameObject bank, byte tabId)
		{
			if (bank == null) return;
			if (chr.Guild == null || chr.GuildMember == null) return;
			if (!bank.CanInteractWith(chr)) return;

			var bankTab = chr.Guild.Bank[tabId];
			if (bankTab == null) return;
			if (!chr.GuildMember.HasBankTabRight(tabId, GuildBankTabPrivileges.ViewTab)) return;


			SendMemberRemainingDailyWithdrawlAllowance(chr, chr.GuildMember.BankMoneyWithdrawlAllowance);

			SendGuildBankTabContents(chr, bank, tabId);
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:15,代碼來源:GuildHandler.cs

示例5: SendGuildBankList

		private static void SendGuildBankList(Character chr, GameObject bank, byte tabId, bool hasTabNames, bool hasItemInfo)
		{
			if (bank == null) return;
			if (chr.Guild == null || chr.GuildMember == null) return;
			if (!bank.CanInteractWith(chr)) return;

			var guild = chr.Guild;
			var gBank = guild.Bank;

			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GUILD_BANK_LIST))
			{
				packet.Write(guild.Money);
				packet.Write(tabId);
				packet.Write(chr.GuildMember.Rank.BankTabRights[tabId].WithdrawlAllowance);
				packet.Write(hasTabNames);

				if (hasTabNames)
				{
					if (tabId == 0)
					{
						packet.Write((byte)guild.PurchasedBankTabCount);
						for (var i = 0; i < guild.PurchasedBankTabCount; ++i)
						{
							packet.Write(gBank[i].Name);
							packet.Write(gBank[i].Icon);
						}
					}
				}

				packet.Write(hasItemInfo);
				if (!hasItemInfo)
				{
					chr.Client.Send(packet);
					return;
				}

				var bankTab = gBank[tabId];
				for (var slot = 0; slot < GuildMgr.MAX_BANK_TAB_SLOTS; ++slot)
				{
					var item = (slot < bankTab.ItemRecords.Count) ? bankTab.ItemRecords[slot] : null;

					packet.Write((byte)slot);
					if (item == null)
					{
						packet.Write((uint)0);
						continue;
					}

					packet.Write(item.EntryId);
					var randPropId = item.RandomProperty;
					packet.Write(randPropId);
					if (randPropId > 0)
					{
						packet.Write(item.RandomSuffix);
					}

					packet.Write(item.Amount);
					packet.Write((uint)0);
					packet.Write((byte)0);

					if (item.EnchantIds == null)
					{
						packet.Write((byte)0);
						continue;
					}

					var count = 0;
					var list = new int[3];
					for (var i = 0; i < 3; ++i)
					{
						if (item.EnchantIds[i] == 0) continue;
						count++;
						list[i] = item.EnchantIds[i];
					}

					packet.Write((byte)count);
					for (var i = 0; i < 3; ++i)
					{
						if (list[i] == 0) continue;
						packet.Write((byte)i);
						packet.Write(list[i]);
					}
				}

				chr.Client.Send(packet);
			}
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:87,代碼來源:GuildHandler.cs


注:本文中的WCell.RealmServer.Entities.GameObject.CanInteractWith方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。