/// <summary> /// Registers a <see cref="CreateCyclopsCharger" /> method that creates a new <see cref="Charging.CyclopsCharger" /> on demand.<para /> /// This method will be invoked only once for each Cyclops sub in the game world.<para /> /// Use this for rechargable batteries and energy drawn from the environment. /// </summary> /// <typeparam name="T">Your class that implements <see cref="Charging.CyclopsCharger" />.</typeparam> /// <param name="createEvent">A method that takes no parameters a returns a new instance of an <see cref="CreateCyclopsCharger" />.</param> public void CyclopsCharger <T>(CreateCyclopsCharger createEvent) where T : CyclopsCharger { if (ChargeManager.TooLateToRegister) { QuickLogger.Error("CyclopsChargerCreator have already been invoked. This method should only be called during patch time."); } else { ChargeManager.RegisterChargerCreator(createEvent, typeof(T).Name); } }