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


C# InventoryType类代码示例

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


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


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