Пример #1
0
        /// <summary>
        /// Gets the attachment by name at the specified slot.
        /// </summary>
        /// <param name="name">Attachment name</param>
        /// <param name="characterSlot">Index of the character slot we wish to get an attachment from</param>
        /// <returns>null if failed, otherwise the attachment.</returns>
        public Attachment GetAttachment(string name, int characterSlot = 0)
        {
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
#endif

            var ptr = NativeEntityMethods.GetAttachmentByName(this.GetIEntity(), name, characterSlot);

            return(Attachment.TryAdd(ptr, this));
        }