• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InventoryType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InventoryType的典型用法代码示例。如果您正苦于以下问题:C# InventoryType类的具体用法?C# InventoryType怎么用?C# InventoryType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InventoryType类属于命名空间,在下文中一共展示了InventoryType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateInventoryItem

        /// <summary>
        /// Creates a notecard in the objects folder and specify an item id.
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="itemName"></param>
        /// <param name="itemId"></param>
        /// <param name="assetId"></param>
        /// <param name="userId"></param>
        /// <param name="type">Type of item to create</param>
        /// <returns></returns>
        public static InventoryItemBase CreateInventoryItem(
            Scene scene, string itemName, UUID itemId, UUID assetId, UUID userId, InventoryType type)
        {
            AssetBase asset = null;

            if (type == InventoryType.Notecard)
                asset = AssetHelpers.CreateAsset(scene, userId);
            else if (type == InventoryType.Object)
                asset = AssetHelpers.CreateAsset(assetId, SceneHelpers.CreateSceneObject(1, userId));
            else
                throw new Exception(string.Format("Inventory type {0} not supported", type));

            scene.AssetService.Store(asset);

            InventoryItemBase item = new InventoryItemBase();
            item.Name = itemName;
            item.AssetID = asset.FullID;
            item.ID = itemId;
            item.Owner = userId;
            item.AssetType = asset.Type;
            item.InvType = (int)type;

            InventoryFolderBase folder = scene.InventoryService.GetFolderForType(userId, AssetType.Notecard);
            
            item.Folder = folder.ID;
            scene.AddInventoryItem(item);
            
            return item;
        }
开发者ID:NovaGrid,项目名称:opensim,代码行数:39,代码来源:UserInventoryHelpers.cs


示例2: InventoryPage

 internal InventoryPage(InventoryType type, StorageType storage, byte size, Item bag = null)
 {
     _type = type;
                 _storage = storage;
                 Size = size;
                 Bag = bag;
 }
开发者ID:ephe-meral,项目名称:gw-interface,代码行数:7,代码来源:InventoryPage.cs


示例3: Create

 public static InvPayload Create(InventoryType type, params UInt256[] hashes)
 {
     return new InvPayload
     {
         Inventories = hashes.Select(p => new InventoryVector { Type = type, Hash = p }).ToArray()
     };
 }
开发者ID:cole2295,项目名称:AntShares,代码行数:7,代码来源:InvPayload.cs


示例4: InventoryPouch

 public InventoryPouch(InventoryType type, ushort[] legal, int maxcount, int offset, int size = -1)
 {
     Type = type;
     LegalItems = legal;
     MaxCount = maxcount;
     Offset = offset;
     PouchDataSize = size > -1 ? size : legal.Length;
 }
开发者ID:themrrobert,项目名称:PKHeX,代码行数:8,代码来源:Inventory.cs


示例5: InventoryItem

 public InventoryItem (ushort iD, byte index, uint count, uint flag, uint price, ushort extra, InventoryType loc)
 {
     ID = iD;
     Index = index;
     Count = count;
     Flag = flag;
     Price = price;
     Extra = extra;
     Location = loc;
 }
开发者ID:rmforr2,项目名称:FFACETools_ffevo.net,代码行数:10,代码来源:Item.cs


示例6: Inventory

        public Inventory(Character pOwner, InventoryType invtype, byte slotLimit = 96)
        {
            Items = new Dictionary<byte, Item>(slotLimit);
              Equips = new Dictionary<short, Equip>();

              if ((int)invtype >= 2 || (int)invtype <= 5)
                  ItemAmounts = new Dictionary<int, short>();

              SlotLimit = slotLimit;
              InventoryType = invtype;
              Owner = pOwner;
        }
开发者ID:DragonNeos,项目名称:serenity-maple,代码行数:12,代码来源:Inventory.cs


示例7: GetFolderForType

        public virtual InventoryFolderBase GetFolderForType(UUID principalID, InventoryType invType, AssetType type)
        {
            Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE",
                    new Dictionary<string,object> {
                        { "PRINCIPAL", principalID.ToString() },
                        { "TYPE", ((int)type).ToString() },
                        { "INVTYPE", ((int)invType).ToString() }
                    });

            if (ret == null)
                return null;
            if (ret.Count == 0)
                return null;

            return BuildFolder((Dictionary<string, object>)ret["folder"]);
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:16,代码来源:XInventoryConnector.cs


示例8: CreateInventoryItem

 public static InventoryItem CreateInventoryItem(InventoryType type, UUID id)
 {
     switch (type)
     {
         case InventoryType.Texture: return new InventoryTexture(id);
         case InventoryType.Sound: return new InventorySound(id);
         case InventoryType.CallingCard: return new InventoryCallingCard(id);
         case InventoryType.Landmark: return new InventoryLandmark(id);
         case InventoryType.Object: return new InventoryObject(id);
         case InventoryType.Notecard: return new InventoryNotecard(id);
         case InventoryType.Category: return new InventoryCategory(id);
         case InventoryType.LSL: return new InventoryLSL(id);
         case InventoryType.Snapshot: return new InventorySnapshot(id);
         case InventoryType.Attachment: return new InventoryAttachment(id);
         case InventoryType.Wearable: return new InventoryWearable(id);
         case InventoryType.Animation: return new InventoryAnimation(id);
         case InventoryType.Gesture: return new InventoryGesture(id);
         default: return new InventoryItem(type, id);
     }
 }
开发者ID:zadark,项目名称:par,代码行数:20,代码来源:InventoryFun.cs


示例9: AddInventoryItem

        /// <summary>
        /// Creates a notecard in the objects folder and specify an item id.
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="itemName"></param>
        /// <param name="itemId"></param>
        /// <param name="itemType"></param>
        /// <param name="asset">The serialized asset for this item</param>
        /// <param name="userId"></param>
        /// <returns></returns>
        private static InventoryItemBase AddInventoryItem(
            Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId)
        {
            scene.AssetService.Store(asset);

            InventoryItemBase item = new InventoryItemBase();
            item.Name = itemName;
            item.AssetID = asset.FullID;
            item.ID = itemId;
            item.Owner = userId;
            item.AssetType = asset.Type;
            item.InvType = (int)itemType;

            InventoryFolderBase folder = scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type);

            item.Folder = folder.ID;
            scene.AddInventoryItem(item);

            return item;
        }
开发者ID:p07r0457,项目名称:opensim,代码行数:30,代码来源:UserInventoryHelpers.cs


示例10: Inventory

        public Inventory(Int32 x, Int32 y, Int32 numPages)
        {
            _map = null;
            _gridSpace = null;
            _inventoryType = InventoryType.None;
            _owner = null;
            _doubleCheckBlock = false;
            _dirty = false;
            _x = x;
            _y = y;
            _numPages = numPages;

            if (_x <= 0)
                _x = 1;

            if (_y <= 0)
                _y = 1;

            if (_numPages <= 0)
                _numPages = 1;

            CreateGridSpace();
        }
开发者ID:4ptiv4,项目名称:GenesisSharp,代码行数:23,代码来源:Inventory.cs


示例11: TaskItemReceivedEventArgs

 public TaskItemReceivedEventArgs(UUID itemID, UUID folderID, UUID creatorID, UUID assetID, InventoryType type)
 {
     this.m_ItemID = itemID;
     this.m_FolderID = folderID;
     this.m_CreatorID = creatorID;
     this.m_AssetID = assetID;
     this.m_Type = type;
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:8,代码来源:InventoryManager.cs


示例12: CreateLink

        /// <summary>
        /// Creates inventory link to another inventory item or folder
        /// </summary>
        /// <param name="folderID">Put newly created link in folder with this UUID</param>
        /// <param name="itemID">Original item's UUID</param>
        /// <param name="name">Name</param>
        /// <param name="description">Description</param>
        /// <param name="assetType">Asset Type</param>
        /// <param name="invType">Inventory Type</param>
        /// <param name="transactionID">Transaction UUID</param>
        /// <param name="callback">Method to call upon creation of the link</param>
        public void CreateLink(UUID folderID, UUID itemID, string name, string description, AssetType assetType, InventoryType invType, UUID transactionID, ItemCreatedCallback callback)
        {
            LinkInventoryItemPacket create = new LinkInventoryItemPacket();
            create.AgentData.AgentID = Client.Self.AgentID;
            create.AgentData.SessionID = Client.Self.SessionID;

            create.InventoryBlock.CallbackID = RegisterItemCreatedCallback(callback);
            create.InventoryBlock.FolderID = folderID;
            create.InventoryBlock.TransactionID = transactionID;
            create.InventoryBlock.OldItemID = itemID;
            create.InventoryBlock.Type = (sbyte)assetType;
            create.InventoryBlock.InvType = (sbyte)invType;
            create.InventoryBlock.Name = Utils.StringToBytes(name);
            create.InventoryBlock.Description = Utils.StringToBytes(description);
            
            Client.Network.SendPacket(create);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:28,代码来源:InventoryManager.cs


示例13: InventoryItem

 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public InventoryItem(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     AssetUUID = (UUID)info.GetValue("AssetUUID", typeof(UUID));
     Permissions = (Permissions)info.GetValue("Permissions", typeof(Permissions));
     AssetType = (AssetType)info.GetValue("AssetType", typeof(AssetType));
     InventoryType = (InventoryType)info.GetValue("InventoryType", typeof(InventoryType));
     CreatorID = (UUID)info.GetValue("CreatorID", typeof(UUID));
     Description = (string)info.GetValue("Description", typeof(string));
     GroupID = (UUID)info.GetValue("GroupID", typeof(UUID));
     GroupOwned = (bool)info.GetValue("GroupOwned", typeof(bool));
     SalePrice = (int)info.GetValue("SalePrice", typeof(int));
     SaleType = (SaleType)info.GetValue("SaleType", typeof(SaleType));
     Flags = (uint)info.GetValue("Flags", typeof(uint));
     CreationDate = (DateTime)info.GetValue("CreationDate", typeof(DateTime));
     LastOwnerID = (UUID)info.GetValue("LastOwnerID", typeof(UUID));
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:21,代码来源:InventoryManager.cs


示例14: RequestCreateItemFromAsset

        /// <summary>
        /// Create an inventory item and upload asset data
        /// </summary>
        /// <param name="data">Asset data</param>
        /// <param name="name">Inventory item name</param>
        /// <param name="description">Inventory item description</param>
        /// <param name="assetType">Asset type</param>
        /// <param name="invType">Inventory type</param>
        /// <param name="folderID">Put newly created inventory in this folder</param>
        /// <param name="callback">Delegate that will receive feedback on success or failure</param>
        public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
            InventoryType invType, UUID folderID, ItemCreatedFromAssetCallback callback)
        {
            Permissions permissions = new Permissions();
            permissions.EveryoneMask = PermissionMask.None;
            permissions.GroupMask = PermissionMask.None;
            permissions.NextOwnerMask = PermissionMask.All;

            RequestCreateItemFromAsset(data, name, description, assetType, invType, folderID, permissions, callback);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:20,代码来源:InventoryManager.cs


示例15: GetFolderForType

 public override InventoryFolderBase GetFolderForType(UUID principalID, InventoryType invType, AssetType type)
 {
     InventoryFolderBase invFolder = GetRootFolder (principalID);
     switch (type)
     {
         case AssetType.Object:
             InventoryFolderBase objFolder = GetFolderType (principalID, invFolder.ID, type);
             if (objFolder == null)
                 objFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Object, "Foreign Objects");
             return objFolder;
         case AssetType.LSLText:
             InventoryFolderBase lslFolder = GetFolderType (principalID, invFolder.ID, type);
             if (lslFolder == null)
                 lslFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.LSLText, "Foreign Scripts");
             return lslFolder;
         case AssetType.Notecard:
             InventoryFolderBase ncFolder = GetFolderType (principalID, invFolder.ID, type);
             if (ncFolder == null)
                 ncFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Notecard, "Foreign Notecards");
             return ncFolder;
         case AssetType.Animation:
             InventoryFolderBase aniFolder = GetFolderType (principalID, invFolder.ID, type);
             if (aniFolder == null)
                 aniFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Notecard, "Foreign Animiations");
             return aniFolder;
         case AssetType.Bodypart:
         case AssetType.Clothing:
             InventoryFolderBase clothingFolder = GetFolderType (principalID, invFolder.ID, AssetType.Clothing);
             if (clothingFolder == null)
                 clothingFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Clothing, "Foreign Clothing");
             return clothingFolder;
         case AssetType.Gesture:
             InventoryFolderBase gestureFolder = GetFolderType (principalID, invFolder.ID, type);
             if (gestureFolder == null)
                 gestureFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Gesture, "Foreign Gestures");
             return gestureFolder;
         case AssetType.Landmark:
             InventoryFolderBase lmFolder = GetFolderType (principalID, invFolder.ID, type);
             if (lmFolder == null)
                 lmFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Landmark, "Foreign Landmarks");
             return lmFolder;
         case AssetType.SnapshotFolder:
         case AssetType.Texture:
             InventoryFolderBase textureFolder = GetFolderType (principalID, invFolder.ID, type);
             if (textureFolder == null)
                 textureFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Landmark, "Foreign Textures");
             return textureFolder;
         case AssetType.Sound:
             InventoryFolderBase soundFolder = GetFolderType (principalID, invFolder.ID, type);
             if (soundFolder == null)
                 soundFolder = CreateFolder (principalID, invFolder.ID, (int)AssetType.Landmark, "Foreign Sounds");
             return soundFolder;
         default:
             return invFolder;
     }
 }
开发者ID:KSLcom,项目名称:Aurora-HG-Plugin,代码行数:56,代码来源:HGExternalInventoryService.cs


示例16: InventoryVector

		public InventoryVector(InventoryType type, uint256 hash)
		{
			Type = type;
			Hash = hash;
		}
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:5,代码来源:InventoryVector.cs


示例17: GetItemCountByIndex

            } // @ public uint GetItemCountByIndex(byte index, InventoryType location)

            /// <summary>
            /// Will get an item ID by index in the passed location
            /// </summary>
            /// <param name="index">Index of the item in your inventory</param>
            /// <param name="location">InventoryType of the location to search (SINGLE LOCATION)</param>
            public int GetItemIDByIndex (int index, InventoryType location)
            {
                if (IsSet(location, InventoryType.None))
                    return 0;

                DoRangeChecks(index, location);
                InventoryItem item = GetItem(index, location);
                if (item != null)
                    return item.ID;
                return 0;
            } // @ public int GetItemIDByIndex(byte index, InventoryType location)
开发者ID:rmforr2,项目名称:FFACETools_ffevo.net,代码行数:18,代码来源:Item.cs


示例18: GetInventorySlotsByEquipSlot

 public static IEnumerable<EquipSlot> GetInventorySlotsByEquipSlot(InventoryType type)
 {
     switch (type)
     {
         case InventoryType.Head:
             yield return EquipSlot.Head;
             break;
         case InventoryType.Neck:
             yield return EquipSlot.Neck;
             break;
         case InventoryType.Shoulders:
             yield return EquipSlot.Shoulders;
             break;
         case InventoryType.Body:
             yield return EquipSlot.Body;
             break;
         case InventoryType.Chest:
         case InventoryType.Robe:
             yield return EquipSlot.Chest;
             break;
         case InventoryType.Waist:
             yield return EquipSlot.Waist;
             break;
         case InventoryType.Legs:
             yield return EquipSlot.Legs;
             break;
         case InventoryType.Feet:
             yield return EquipSlot.Feet;
             break;
         case InventoryType.Wrists:
             yield return EquipSlot.Wrists;
             break;
         case InventoryType.Hands:
             yield return EquipSlot.Hands;
             break;
         case InventoryType.Finger:
             yield return EquipSlot.Finger1;
             yield return EquipSlot.Finger2;
             break;
         case InventoryType.Trinket:
             yield return EquipSlot.Trinket1;
             yield return EquipSlot.Trinket2;
             break;
         case InventoryType.Weapon:
             yield return EquipSlot.MainHand;
             yield return EquipSlot.OffHand;
             break;
         case InventoryType.Shield:
         case InventoryType.WeaponOffHand:
         case InventoryType.Holdable:
             yield return EquipSlot.OffHand;
             break;
         case InventoryType.Ranged:
         case InventoryType.Thrown:
         case InventoryType.RangedRight:
         case InventoryType.Relic:
             yield return EquipSlot.Ranged;
             break;
         case InventoryType.Cloak:
             yield return EquipSlot.Back;
             break;
         case InventoryType.TwoHandedWeapon:
             {
                 yield return EquipSlot.MainHand;
                 // TODO: Check for titan's grip
                 //bool flag = Manager.LocalPlayer.Class == WoWClass.Warrior && WoWScript.Execute<int>(InventoryManager.#a(61464), 4u) > 0;
                 //var mainHand = Manager.LocalPlayer.GetEquippedItem(EquipSlot.MainHand);
                 //if (flag && mainHand != null && mainHand.ItemInfo.InventoryType == InventoryType.TwoHandedWeapon)
                 //{
                 //    yield return EquipSlot.OffHand;
                 //}
                 break;
             }
         case InventoryType.Bag:
         case InventoryType.Quiver:
             yield return EquipSlot.Bag1;
             yield return EquipSlot.Bag2;
             yield return EquipSlot.Bag3;
             yield return EquipSlot.Bag4;
             break;
         case InventoryType.Tabard:
             yield return EquipSlot.Tabard;
             break;
         case InventoryType.WeaponMainHand:
             yield return EquipSlot.MainHand;
             break;
     }
 }
开发者ID:Wrongusername,项目名称:IceFlake,代码行数:88,代码来源:WoWItem.cs


示例19: InventoryTypeToString

 public static string InventoryTypeToString(InventoryType type)
 {
     return _InventoryTypeNames[(int)type];
 }
开发者ID:Belxjander,项目名称:Asuna,代码行数:4,代码来源:InventoryManager.cs


示例20: RequestCreateItemFromAsset

        public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
            InventoryType invType, LLUUID folderID, ItemCreatedFromAssetCallback callback)
        {
            if (_Client.Network.CurrentSim == null || _Client.Network.CurrentSim.Caps == null)
                throw new Exception("NewFileAgentInventory capability is not currently available");

            Uri url = _Client.Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");

            if (url != null)
            {
                LLSDMap query = new LLSDMap();
                query.Add("folder_id", LLSD.FromUUID(folderID));
                query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
                query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
                query.Add("name", LLSD.FromString(name));
                query.Add("description", LLSD.FromString(description));

                byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);

                // Make the request
                CapsClient request = new CapsClient(url);
                request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
                request.UserData = new KeyValuePair<ItemCreatedFromAssetCallback, byte[]>(callback, data);
                request.StartRequest(postData);
            }
            else
            {
                throw new Exception("NewFileAgentInventory capability is not currently available");
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:30,代码来源:InventoryManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InvocationExpression类代码示例发布时间:2022-05-24
下一篇:
C# InventorySlot类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap