当前位置: 首页>>代码示例>>C#>>正文


C# PlayerMobile.EquipItem方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerMobile.EquipItem方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.EquipItem方法的具体用法?C# PlayerMobile.EquipItem怎么用?C# PlayerMobile.EquipItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.EquipItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RestoreState


//.........这里部分代码省略.........
								if (parent != null)
								{
									if (item == pack || item == bank)
									{
										m.AddItem(item);
									}
									else if (parent == pack || parent == oldPack)
									{
										p = item.Location;
										pack.DropItem(item);
										item.Location = p;
									}
									else if (parent == bank || parent == oldBank)
									{
										p = item.Location;
										bank.DropItem(item);
										item.Location = p;
									}
									else if (parent is Container)
									{
										if (parent.Deleted)
										{
											bank.DropItem(item);
										}
										else
										{
											p = item.Location;
											((Container)parent).DropItem(item);
											item.Location = p;
										}
									}
									else if (parent is Mobile)
									{
										if (!m.EquipItem(item))
										{
											pack.DropItem(item);
										}
									}
									else
									{
										bank.DropItem(item);
									}

									item.SetLastMoved();
									item.UpdateTotals();
									item.Delta(ItemDelta.Update);
								}
								else if (Cleanup.IsBuggable(item))
								{
									--idxCreated;
									++idxDeleted;

									item.Delete();
								}
								else
								{
									item.Internalize();
								}
							}

							if (oldPack != null && oldPack != pack && !restored.ContainsKey(oldPack))
							{
								oldPack.Delete();
							}

							if (oldBank != null && oldBank != bank && !restored.ContainsKey(oldBank))
开发者ID:Ravenwolfe,项目名称:Core,代码行数:67,代码来源:PlayerBackup.cs

示例2: LoadPlayer

        public void LoadPlayer(PlayerMobile pm)
        {
            Backpack pack = (Backpack)pm.Backpack;
			//pm.SendMessage(String.Format("SettingBackpack"));
			
			TeleportAllPets( pm, (Point3D)PlayerLocations[pm.Serial], (Map)PlayerMaps[pm.Serial] );
			
            pm.Location = (Point3D)PlayerLocations[pm.Serial];
			PlayerLocations.Remove(pm.Serial);
			//pm.SendMessage(String.Format("SettingLocation"));
			
            pm.Map = (Map)PlayerMaps[pm.Serial];
			PlayerMaps.Remove(pm.Serial);
			//pm.SendMessage(String.Format("SettingMap"));

            ArrayList items = (ArrayList)PlayerItems[pm.Serial];
			PlayerItems.Remove(pm.Serial);
			//pm.SendMessage(String.Format("Setting Arraylist of Items"));
            for (int i = 0; i < items.Count; ++i)
            {
				//pm.SendMessage(String.Format("LoadPlayer() {0} / {1}.", i , items.Count));
                Item item = (Item)items[i];
                if (item.Layer == Layer.Invalid)
                {
					//pm.SendMessage(String.Format("Layer Invalid!"));
                    item.Location = (Point3D)ItemLocations[item.Serial];
					ItemLocations.Remove(item.Serial);
                    pack.AddItem(item);
                }
                else
                {
                    Item test = (Item)pm.FindItemOnLayer(item.Layer);

                    if (test == null || test == item)
                    {
						ItemLocations.Remove(item.Serial);
                        pm.EquipItem(item);
                        test = (Item)pm.FindItemOnLayer(item.Layer);
                        if ( test == null )
                        	pack.AddItem(item);
                    }
                    else
                    {
                        item.Location = (Point3D)ItemLocations[item.Serial];
						ItemLocations.Remove(item.Serial);
                        if (item != pm.Backpack && item != pm.BankBox)
                            pack.AddItem(item);
                    }
                }
            }
	    
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:52,代码来源:FieldController.cs


注:本文中的Server.Mobiles.PlayerMobile.EquipItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。