LazyLib

org.lazywizard.lazylib
Class LazyLib

Object
  extended by BaseModPlugin
      extended by LazyLib
All Implemented Interfaces:
ModPlugin

public class LazyLib
extends BaseModPlugin

Contains information on the current version of LazyLib.

Since:
1.1
Author:
LazyWizard

Constructor Summary
LazyLib()
           
 
Method Summary
static String getInfo()
          Gets the library information (for startup messages, etc).
static Level getLogLevel()
          Returns the log level used for all other LazyLib classes.
static String getSupportedGameVersion()
          Returns the Starsector release this version was coded for.
static float getVersion()
          Returns the installed version of LazyLib.
static boolean isDevBuild()
          Checks if this is a development (potentially unstable) build of LazyLib.
 void onApplicationLoad()
           
static void onDeprecatedMethodUsage(Class source, String methodSig)
          Called internally by LazyLib when a deprecated method is used.
static void setLogLevel(Level level)
          Sets the log level used for all other LazyLib classes.
 
Methods inherited from class BaseModPlugin
afterGameSave, beforeGameSave, onEnabled, onGameLoad, onNewGame, pickDroneAI, pickMissileAI, pickShipAI, pickWeaponAutofireAI
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyLib

public LazyLib()
Method Detail

getVersion

public static float getVersion()
Returns the installed version of LazyLib.

Returns:
The current version of LazyLib, as a Float.

Since:
1.1

getSupportedGameVersion

public static String getSupportedGameVersion()
Returns the Starsector release this version was coded for.

Returns:
The version of Starsector this library supports, as a String.

Since:
1.2

isDevBuild

public static boolean isDevBuild()
Checks if this is a development (potentially unstable) build of LazyLib.

Returns:
true if this is a beta build of LazyLib, false otherwise.

Since:
1.4

getInfo

public static String getInfo()
Gets the library information (for startup messages, etc).

Returns:
A String containing information on the library.

Since:
1.2

getLogLevel

public static Level getLogLevel()
Returns the log level used for all other LazyLib classes. LazyLib itself will always use log level Level.ALL.

Returns:
The current log level for all LazyLib classes.

Since:
1.6b

setLogLevel

public static void setLogLevel(Level level)
Sets the log level used for all other LazyLib classes.

Parameters:
level - The minimum level of entries that will be logged.

Since:
1.6

onDeprecatedMethodUsage

public static void onDeprecatedMethodUsage(Class source,
                                           String methodSig)
Called internally by LazyLib when a deprecated method is used. If "logDeprecated" is set in lazylib_settings.json it will log usage of those methods. If "crashOnDeprecated" is true, this method will throw a RuntimeException so modders can track down the problematic code using the stacktrace. You can ignore this method; there's no reason to ever call it manually.

Parameters:
source - The class that contains the deprecated method.
methodSig - The signature of the method that is deprecated.

Since:
1.7

onApplicationLoad

public void onApplicationLoad()
                       throws Exception
Specified by:
onApplicationLoad in interface ModPlugin
Overrides:
onApplicationLoad in class BaseModPlugin
Throws:
Exception

LazyLib