public static string GetPluralName(this Weenie weenie)
        {
            var pluralName = weenie.GetProperty(PropertyString.PluralName);

            if (pluralName == null)
            {
                pluralName = weenie.GetProperty(PropertyString.Name).Pluralize();
            }

            return(pluralName);
        }
示例#2
0
        public static int GetStackUnitEncumbrance(this Weenie weenie)
        {
            if (weenie.IsStackable())
            {
                var stackUnitEncumbrance = weenie.GetProperty(PropertyInt.StackUnitEncumbrance);

                if (stackUnitEncumbrance != null)
                {
                    return(stackUnitEncumbrance.Value);
                }
            }
            return(weenie.GetProperty(PropertyInt.EncumbranceVal) ?? 0);
        }
示例#3
0
        public static int GetMaxStackSize(this Weenie weenie)
        {
            if (weenie.IsStackable())
            {
                var maxStackSize = weenie.GetProperty(PropertyInt.MaxStackSize);

                if (maxStackSize != null)
                {
                    return(maxStackSize.Value);
                }
            }
            return(1);
        }
        public static bool IsVendorService(this Weenie weenie)
        {
            var vendorService = weenie.GetProperty(PropertyBool.VendorService) ?? false;

            return(vendorService);
        }
        public static bool RequiresBackpackSlotOrIsContainer(this Weenie weenie)
        {
            var requiresBackPackSlot = weenie.GetProperty(PropertyBool.RequiresBackpackSlot) ?? false;

            return(requiresBackPackSlot || weenie.WeenieType == WeenieType.Container);
        }
        public static bool IsStuck(this Weenie weenie)
        {
            var stuck = weenie.GetProperty(PropertyBool.Stuck) ?? false;

            return(stuck);
        }
        // =====================================
        // Utility
        // =====================================

        public static string GetName(this Weenie weenie)
        {
            var name = weenie.GetProperty(PropertyString.Name);

            return(name);
        }
示例#8
0
 public static bool IsStuck(this Weenie weenie)
 {
     return(weenie.GetProperty(PropertyBool.Stuck) ?? false);
 }
示例#9
0
        public static int?GetValue(this Weenie weenie)
        {
            var value = weenie.GetProperty(PropertyInt.Value);

            return(value);
        }
示例#10
0
        public static ItemType GetItemType(this Weenie weenie)
        {
            var itemType = weenie.GetProperty(PropertyInt.ItemType) ?? 0;

            return((ItemType)itemType);
        }