From 1650b2bd209631a05b9d9c009227195c1ead9726 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 6 Feb 2017 07:02:04 +0800 Subject: [PATCH] [csharp] Added to docs in Skin.cs --- spine-csharp/src/Skin.cs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/spine-csharp/src/Skin.cs b/spine-csharp/src/Skin.cs index 318779f77..973e49129 100644 --- a/spine-csharp/src/Skin.cs +++ b/spine-csharp/src/Skin.cs @@ -32,38 +32,47 @@ using System; using System.Collections.Generic; namespace Spine { - /// Stores attachments by slot index and attachment name. + /// Stores attachments by slot index and attachment name. + /// See SkeletonData , Skeleton , and + /// Runtime skins in the Spine Runtimes Guide. + /// public class Skin { internal String name; private Dictionary attachments = new Dictionary(AttachmentKeyTupleComparer.Instance); - public String Name { get { return name; } } + public string Name { get { return name; } } public Dictionary Attachments { get { return attachments; } } - public Skin (String name) { + public Skin (string name) { if (name == null) throw new ArgumentNullException("name", "name cannot be null."); this.name = name; } - public void AddAttachment (int slotIndex, String name, Attachment attachment) { + public void AddAttachment (int slotIndex, string name, Attachment attachment) { if (attachment == null) throw new ArgumentNullException("attachment", "attachment cannot be null."); attachments[new AttachmentKeyTuple(slotIndex, name)] = attachment; } /// May be null. - public Attachment GetAttachment (int slotIndex, String name) { + public Attachment GetAttachment (int slotIndex, string name) { Attachment attachment; attachments.TryGetValue(new AttachmentKeyTuple(slotIndex, name), out attachment); return attachment; } - public void FindNamesForSlot (int slotIndex, List names) { + /// Finds the skin keys for a given slot. The results are added to the passed List(names). + /// The target slotIndex. To find the slot index, use or + /// Found skin key names will be added to this list. + public void FindNamesForSlot (int slotIndex, List names) { if (names == null) throw new ArgumentNullException("names", "names cannot be null."); foreach (AttachmentKeyTuple key in attachments.Keys) if (key.slotIndex == slotIndex) names.Add(key.name); } + /// Finds the attachments for a given slot. The results are added to the passed List(Attachment). + /// The target slotIndex. To find the slot index, use or + /// Found Attachments will be added to this list. public void FindAttachmentsForSlot (int slotIndex, List attachments) { if (attachments == null) throw new ArgumentNullException("attachments", "attachments cannot be null."); foreach (KeyValuePair entry in this.attachments)