Exemple #1
0
        /// <summary>
        /// Call this in <see cref="ModItem.SetStaticDefaults"/> to register this item into the "clicker class" category
        /// </summary>
        /// <param name="modItem">The <see cref="ModItem"/> that is to be registered</param>
        /// <exception cref="InvalidOperationException"/>
        public static void RegisterClickerItem(ModItem modItem)
        {
            if (ClickerClass.finalizedRegisterCompat)
            {
                throw new InvalidOperationException("Tried to register a clicker item at the wrong time, do so in ModItem.SetStaticDefaults");
            }
            int type = modItem.item.type;

            if (!ClickerItems.Contains(type))
            {
                ClickerItems.Add(type);
            }
        }
Exemple #2
0
 /// <summary>
 /// Call this to check if an item type belongs to the "clicker class" category
 /// </summary>
 /// <param name="type">The item type to be checked</param>
 /// <returns><see langword="true"/> if that category</returns>
 public static bool IsClickerItem(int type)
 {
     return(ClickerItems.Contains(type));
 }