コード例 #1
0
        public static string PageCodeForStack(ItemStack stack)
        {
            if (stack.Attributes != null && stack.Attributes.Count > 0)
            {
                ITreeAttribute tree = stack.Attributes.Clone();
                foreach (var val in GlobalConstants.IgnoredStackAttributes)
                {
                    tree.RemoveAttribute(val);
                }
                tree.RemoveAttribute("durability");

                if (tree.Count != 0)
                {
                    string treeStr = tree.ToJsonToken();
                    return((stack.Class.Name()) + "-" + stack.Collectible.Code.ToShortString() + "-" + treeStr);
                }
            }

            return((stack.Class.Name()) + "-" + stack.Collectible.Code.ToShortString());
        }