Example #1
0
        /// <summary>
        /// Registers a max ammo check for an Identifiable
        /// </summary>
        /// <param name="slot">The slot in the inventory</param>
        /// <param name="getter">The action to get the ammo</param>
        public static void RegisterMaxAmmo(int slot, MaxAmmo getter)
        {
            if (ModLoader.CurrentStep != LoadingState.REGISTER)
            {
                throw new Exception("You can only register things during the 'Register' step");
            }

            MAX_AMMO_SLOT[slot] = getter;
        }
Example #2
0
        /// <summary>
        /// Registers a max ammo check for an Identifiable
        /// </summary>
        /// <param name="id">The ID of the identifiable</param>
        /// <param name="getter">The action to get the ammo</param>
        public static void RegisterMaxAmmo(Identifiable.Id id, MaxAmmo getter)
        {
            if (ModLoader.CurrentStep != LoadingState.REGISTER)
            {
                throw new Exception("You can only register things during the 'Register' step");
            }

            MAX_AMMO_IDENT[id] = getter;
        }