### Java Example: LazyFont Combat Plugin Initialization Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.html An example Java plugin demonstrating how to load a LazyFont and create a DrawableString for rendering text within a Starsector combat engine. It shows font loading, error handling, and initialization of the drawable string. ```Java package data.scripts.plugins; import com.fs.starfarer.api.Global; import com.fs.starfarer.api.combat.BaseEveryFrameCombatPlugin; import com.fs.starfarer.api.combat.CombatEngineAPI; import com.fs.starfarer.api.combat.ViewportAPI; import org.lazywizard.lazylib.ui.FontException; import org.lazywizard.lazylib.ui.LazyFont; import org.lwjgl.input.Mouse; import java.awt.*; public class LazyFontExample extends BaseEveryFrameCombatPlugin { private LazyFont.DrawableString toDraw; // Set up the font and the DrawableString; only has to be done once @Override public void init(CombatEngineAPI engine) { // Load the chosen .fnt file // Fonts are cached globally, so it's acceptable for each class using the same // font to request their own copy of it - they will all share the underlying data final LazyFont font; try { font = LazyFont.loadFont("graphics/fonts/insignia15LTaa.fnt"); } // FontException is thrown if the .fnt file does not exist or has malformed data catch (FontException ex) { Global.getLogger(this.getClass()).error("Failed to load font", ex); engine.removePlugin(this); } ``` -------------------------------- ### Get LazyLib Version Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Returns the running version of the LazyLib library. This static method can be used to check the installed library version. ```APIDOC LazyLib.getVersion() ``` -------------------------------- ### LazyFont.TextAlignment Method Summary Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.TextAlignment.html Summarizes the static methods available for the `LazyFont.TextAlignment` enum, including `valueOf` to get an enum constant by name and `values` to get all constants, along with methods inherited from `java.lang.Enum`. ```APIDOC Methods: - static LazyFont.TextAlignment valueOf(String name) Description: Returns the enum constant of this class with the specified name. - static LazyFont.TextAlignment[] values() Description: Returns an array containing the constants of this enum class, in the order they are declared. Inherited Methods from java.lang.Enum: (See java.lang.Enum documentation for details) ``` -------------------------------- ### API Documentation for org.lazywizard.lazylib.ui Package Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/package-summary.html Detailed API reference for the org.lazywizard.lazylib.ui package, outlining its core functionality, related packages within the LazyLib project, and a comprehensive list of all classes and interfaces it contains, along with their brief descriptions. ```APIDOC Package: org.lazywizard.lazylib.ui Description: Contains classes and methods for rendering text and simple GUI elements. Related Packages: org.lazywizard.lazylib: Contains general methods that mostly help with non-API data types. org.lazywizard.lazylib.campaign: Contains campaign helper classes. org.lazywizard.lazylib.combat: Contains combat helper classes. org.lazywizard.lazylib.opengl: Contains classes to help with drawing OpenGL primitives. Classes and Interfaces: Class: FontException Description: Thrown if LazyFont.loadFont(String) encounters an error loading or parsing a bitmap font. Class: LazyFont Description: An efficiently drawable bitmap font implementation. Enum Class: LazyFont.TextAlignment Description: Represents the alignment of text within a LazyFont.DrawableString's render area. Enum Class: LazyFont.TextAnchor Description: Represents the origin of drawing for LazyFont.DrawableStrings. ``` -------------------------------- ### Java API: CampaignUtils.IncludeRep Enum Methods Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/class-use/CampaignUtils.IncludeRep.html Documents methods within the `CampaignUtils.IncludeRep` enum itself for retrieving its constants. This includes `valueOf` to get an enum constant by its string name and `values` to get an array of all declared constants. ```APIDOC CampaignUtils.IncludeRep: valueOf(name: String): CampaignUtils.IncludeRep name: The name of the enum constant to return. Returns: The enum constant with the specified name. values(): CampaignUtils.IncludeRep[] Returns: An array containing the constants of this enum class, in the order they are declared. ``` -------------------------------- ### API: DefenseUtils Class (org.lazywizard.lazylib.combat) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/package-summary.html Documents the `DefenseUtils` class, which contains methods to make working with a ship's armor grid and defenses easier. ```APIDOC class DefenseUtils ``` -------------------------------- ### org.lazywizard.lazylib Package API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/package-summary.html Detailed API documentation for the org.lazywizard.lazylib package, including its purpose, related sub-packages, and a comprehensive list of all classes and interfaces with their descriptions. ```APIDOC package org.lazywizard.lazylib Description: Contains general methods that mostly help with non-API data types. Related Packages: org.lazywizard.lazylib.campaign: Contains campaign helper classes. org.lazywizard.lazylib.combat: Contains combat helper classes. org.lazywizard.lazylib.opengl: Contains classes to help with drawing OpenGL primitives. org.lazywizard.lazylib.ui: Contains classes and methods for rendering text and simple GUI elements. Classes and Interfaces: CollectionUtils (class): Contains methods for working with Collections. CollectionUtils.CollectionFilter (interface): Used with CollectionUtils.filter(Collection, CollectionUtils.CollectionFilter) to filter out unwanted entries in a Collection. CollectionUtils.SortEntitiesByDistance (class): A Comparator that sorts CombatEntityAPIs by distance from the Vector2f passed into the constructor. CollectionUtils.SortTokensByDistance (class): A Comparator that sorts SectorEntityTokens by distance the Vector2f passed into the constructor. CollisionUtils (class): Contains methods for line intersection, bounds and collision detection tests. EllipseUtils (class): Contains methods for dealing with ellipses. FastTrig (class): Math utility class that trades accuracy for speed, often returning several times faster than Math's equivalent functions. IOUtils (class): Contains classes for reading and writing files within the game's classloader restrictions. JSONUtils (class): Contains methods for dealing with JSON objects. JSONUtils.CommonDataJSONObject (class): Provides a wrapper around JSONObject that allows saving and restoring its values to/from the common data folder (saves/common). LazyLib (class): Contains information on the current version of LazyLib. MathUtils (class): Contains methods for working with vectors, angles, distances, and circles. ``` -------------------------------- ### Get Entity Mass (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC float getMass() ``` -------------------------------- ### Java Package: org.lazywizard.lazylib.combat.entities Overview Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/package-summary.html This API documentation describes the `org.lazywizard.lazylib.combat.entities` package, which is part of LazyLib. It focuses on instantiable combat entities within the Starfarer API context. The documentation lists related packages and provides brief descriptions for each class and interface. ```APIDOC Package: org.lazywizard.lazylib.combat.entities Description: Contains instantiable combat entities. Related Packages: org.lazywizard.lazylib.combat Description: Contains combat helper classes. Classes and Interfaces: AnchoredEntity Description: An implementation of CombatEntityAPI that follows and rotates with another anchoring CombatEntityAPI. SimpleEntity Description: A bare-bones implementation of CombatEntityAPI, mostly useful for decorative EMP arc targeting. SimpleEntity.SimpleEntityType Type: Enum Class ``` -------------------------------- ### API: CombatUtils Class (org.lazywizard.lazylib.combat) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/package-summary.html Documents the `CombatUtils` class, which contains methods that deal with the battle map in general. ```APIDOC class CombatUtils ``` -------------------------------- ### Get Entity Hitpoints (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC float getHitpoints() ``` -------------------------------- ### Get Text Content Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.DrawableString.html Returns the text content of the object. ```Java public String getText() ``` ```APIDOC getText(): Returns: The text content as a String. ``` -------------------------------- ### Classes and Interfaces in org.lazywizard.lazylib.campaign Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/package-summary.html Provides an overview of all public classes and interfaces available within the `org.lazywizard.lazylib.campaign` package, including their names and a brief description of their functionality. ```APIDOC Classes and Interfaces: - CampaignUtils (class): Contains methods for working with campaign objects. - CampaignUtils.IncludeRep (enum class): Controls what RepLevels will be accepted by methods that check reputation relative to the RepLevel passed in. - CargoUtils (class): Contains methods for working with cargo and item stacks. - MessageUtils (class): Allows formatted, multi-line, word-wrapped sector messages. ``` -------------------------------- ### Get Entity Shield API (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC ShieldAPI getShield() ``` -------------------------------- ### SimpleEntity Constructor Details Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/SimpleEntity.html Documents the constructor for the `SimpleEntity` class, which facilitates the creation of a combat entity at a specific, predefined location. This implementation is designed to be lightweight, acting as a simple wrapper around a `Vector2f`. ```APIDOC public SimpleEntity(Vector2f location) Description: Creates a CombatEntityAPI that stays in a single, predefined location. This version is a simple wrapper around a Vector2f and costs virtually nothing. Parameters: location: The Vector2f that getLocation() should return. Since: 1.4 ``` -------------------------------- ### SimpleEntity Constructor (ShipEngineAPI) Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Creates a `CombatEntityAPI` that mimics the location of a `ShipEngineControllerAPI.ShipEngineAPI`. ```APIDOC Class: org.lazywizard.lazylib.combat.entities.SimpleEntity Constructor: SimpleEntity(com.fs.starfarer.api.combat.ShipEngineControllerAPI.ShipEngineAPI engine) engine: The ship engine to mimic. ``` -------------------------------- ### Get Entity Owner ID (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC int getOwner() ``` -------------------------------- ### Get Entity Max Hitpoints (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC float getMaxHitpoints() ``` -------------------------------- ### Java Package: org.lazywizard.lazylib.opengl Overview Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/opengl/package-summary.html Provides an overview of the `org.lazywizard.lazylib.opengl` package, including its purpose and a list of related packages. ```APIDOC package org.lazywizard.lazylib.opengl Description: Contains classes to help with drawing OpenGL primitives. Related Packages: - org.lazywizard.lazylib: Contains general methods that mostly help with non-API data types. - org.lazywizard.lazylib.campaign: Contains campaign helper classes. - org.lazywizard.lazylib.combat: Contains combat helper classes. - org.lazywizard.lazylib.ui: Contains classes and methods for rendering text and simple GUI elements. ``` -------------------------------- ### Get Entity Hull Level (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC float getHullLevel() ``` -------------------------------- ### API: AIUtils Class (org.lazywizard.lazylib.combat) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/package-summary.html Documents the `AIUtils` class, which contains methods that deal with a single combat entity and how it views the battle map. ```APIDOC class AIUtils ``` -------------------------------- ### Java Package: org.lazywizard.lazylib.opengl Classes Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/opengl/package-summary.html Lists the main utility classes available within the `org.lazywizard.lazylib.opengl` package, along with their descriptions. ```APIDOC Classes: - ColorUtils (class in org.lazywizard.lazylib.opengl): Contains methods for working with OpenGL and AWT color objects. - DrawUtils (class in org.lazywizard.lazylib.opengl): Contains methods to draw simple 2D shapes using OpenGL primitives. ``` -------------------------------- ### Get Entity Facing Angle (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html _NONFUNCTIONAL/PLACEHOLDER_ ```APIDOC float getFacing() ``` -------------------------------- ### LazyLib Core: getEngine Method Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt Introduces the `getEngine()` method within the core LazyLib class. This method returns null if a different constructor was used for initialization, indicating its specific usage context. ```APIDOC LazyLib: - getEngine(): Returns null if another constructor was used. ``` -------------------------------- ### Get Location from SimpleEntity API Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Returns the location of this entity. ```APIDOC SimpleEntity.getLocation() ``` -------------------------------- ### LazyLib Project Package Summary Source: https://github.com/lazywizard/lazylib/blob/master/docs/allpackages-index.html Lists all available packages in the LazyLib library, along with a brief description of their primary function. This provides an overview of the library's modular structure and the types of functionalities offered by each package. ```APIDOC Package: org.lazywizard.lazylib Description: Contains general methods that mostly help with non-API data types. Package: org.lazywizard.lazylib.campaign Description: Contains campaign helper classes. Package: org.lazywizard.lazylib.campaign.orbits Description: Contains implementations of OrbitAPI. Package: org.lazywizard.lazylib.combat Description: Contains combat helper classes. Package: org.lazywizard.lazylib.combat.entities Description: Contains instantiable combat entities. Package: org.lazywizard.lazylib.opengl Description: Contains classes to help with drawing OpenGL primitives. Package: org.lazywizard.lazylib.ui Description: Contains classes and methods for rendering text and simple GUI elements. ``` -------------------------------- ### Fast Cosine Calculation Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Get the cosine of an angle using a fast approximation. ```APIDOC Class: org.lazywizard.lazylib.FastTrig Method: cos(double angle) Description: Get the cosine of an angle. Parameters: angle: The angle in radians. Returns: double ``` -------------------------------- ### Get Entity Location (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Returns the location of this entity, calculated to be relative to its anchor. ```APIDOC Vector2f getLocation() ``` -------------------------------- ### WeaponUtils Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/WeaponUtils.html Detailed API documentation for the `org.lazywizard.lazylib.combat.WeaponUtils` class, including its purpose, inheritance, and a summary of all static methods for weapon manipulation and target detection. ```APIDOC Class: WeaponUtils Package: org.lazywizard.lazylib.combat Extends: java.lang.Object Description: Contains methods that deal with weapons and weapon arcs. Since: 1.0 Author: LazyWizard Methods: aimTowardsPoint(weapon: com.fs.starfarer.api.combat.WeaponAPI, point: org.lwjgl.util.vector.Vector2f, time: float) Description: Manually adjusts a weapon's aim towards a point. Return Type: void getAlliesInArc(weapon: com.fs.starfarer.api.combat.WeaponAPI) Description: Finds all allied ships within range of a WeaponAPI. Return Type: java.util.List getEnemiesInArc(weapon: com.fs.starfarer.api.combat.WeaponAPI) Description: Finds all enemy ships within range of a WeaponAPI. Return Type: java.util.List getEnemyMissilesInArc(weapon: com.fs.starfarer.api.combat.WeaponAPI) Description: Finds all enemy missiles within range of a WeaponAPI. Return Type: java.util.List getNearestAllyInArc(weapon: com.fs.starfarer.api.combat.WeaponAPI) Description: Find the closest ally in range of a WeaponAPI. Return Type: com.fs.starfarer.api.combat.ShipAPI ``` -------------------------------- ### Get Collision Class for Combat Entity (Java API) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/SimpleEntity.html Retrieves the collision class of a combat entity. ```APIDOC public com.fs.starfarer.api.combat.CollisionClass getCollisionClass() Returns: com.fs.starfarer.api.combat.CollisionClass ``` -------------------------------- ### CombatUtils Class API Documentation Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/CombatUtils.html Detailed API documentation for the `org.lazywizard.lazylib.combat.CombatUtils` class, outlining its purpose, inheritance, and a summary of its static methods for battle map interactions in the Starfarer game engine. ```APIDOC Class: CombatUtils Package: org.lazywizard.lazylib.combat Extends: java.lang.Object Description: Contains methods that deal with the battle map in general. These methods do not respect fog of war, and assume that you are in combat (`Global.getCombatEngine() != null`). If you wish to check fog of war visibility you should use the methods in `AIUtils`. Since: 1.0 Author: LazyWizard See Also: com.fs.starfarer.api.util.Misc Methods: 1. applyForce(entity: CombatEntityAPI, direction: float, force: float) Description: Apply force to an object. Parameters: entity: CombatEntityAPI direction: float force: float Return Type: void 2. applyForce(entity: CombatEntityAPI, direction: org.lwjgl.util.vector.Vector2f, force: float) Description: Apply force to an object. Parameters: entity: CombatEntityAPI direction: org.lwjgl.util.vector.Vector2f force: float Return Type: void 3. centerViewport(newCenter: org.lwjgl.util.vector.Vector2f) Description: Recenters the viewport at a specific point. Parameters: newCenter: org.lwjgl.util.vector.Vector2f Return Type: void 4. getAsteroidsWithinRange(location: org.lwjgl.util.vector.Vector2f, range: float) Description: Returns all asteroids in range of a given location. Parameters: location: org.lwjgl.util.vector.Vector2f range: float Return Type: java.util.List 5. getEntitiesWithinRange(location: org.lwjgl.util.vector.Vector2f, range: float) Description: Returns all entities in range of a given location. Parameters: location: org.lwjgl.util.vector.Vector2f range: float Return Type: java.util.List 6. getFleetMember(ship: com.fs.starfarer.api.combat.ShipAPI) Description: (Description truncated in source) Parameters: ship: com.fs.starfarer.api.combat.ShipAPI Return Type: com.fs.starfarer.api.fleet.FleetMemberAPI ``` -------------------------------- ### LazyLib Core API Methods Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Documentation for the `LazyLib` class, including core application lifecycle and internal utility methods. ```APIDOC Class: LazyLib Method: onApplicationLoad() Description: (No description provided in source) Parameters: None Return Type: void Static Method: onDeprecatedMethodUsage() Description: Called internally by LazyLib when a deprecated method is used. Parameters: None Return Type: void ``` -------------------------------- ### Get Anchor of Combat Entity API Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Returns the CombatEntityAPI instance to which this entity is currently anchored. ```APIDOC public CombatEntityAPI getAnchor() Returns: The CombatEntityAPI this entity is anchored to. Since: 1.5 ``` -------------------------------- ### APIDOC: Get Space Taken By Commodities Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the amount of space taken by all commodities in a CargoAPI object. ```APIDOC getSpaceTakenByCommodities(cargo: CargoAPI): float Description: Returns the amount of space taken by all commodities in a CargoAPI. Parameters: cargo: The CargoAPI to analyze. Returns: The amount of space taken by commodity stacks in cargo. Since: 1.0 ``` -------------------------------- ### DefenseUtils API for Combat Utilities Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Documentation for the `DefenseUtils` class, including constants related to combat mechanics. ```APIDOC Class: DefenseUtils Static Variable: NOT_IN_GRID Description: A constant that represents a point not in a ship's armor grid. Type: Object ``` -------------------------------- ### API Documentation for showMessage Method Overloads Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/MessageUtils.html Documents the overloaded showMessage methods, which are static utility functions designed to format, word-wrap, and output text messages. These methods handle different input configurations, including an optional preamble and message indentation. ```APIDOC Method: showMessage Signature: public static void showMessage(@Nullable String preamble, String message, boolean indentMessage) Description: Formats and word-wraps the supplied text, then outputs it as a sector message. Parameters: preamble: String (nullable) - The header for this message, won't be indented. Can be null. message: String - The main body of text. indentMessage: boolean - Whether to indent each line of the main body. Since: 1.0 ``` ```APIDOC Method: showMessage Signature: public static void showMessage(String message) Description: Formats and word-wraps the supplied text, then outputs it as a sector message. Parameters: message: String - The message to output. Since: 1.0 ``` -------------------------------- ### APIDOC: Get Space Taken By Fuel Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the amount of space taken by fuel in a CargoAPI object. ```APIDOC getSpaceTakenByFuel(cargo: CargoAPI): float Description: Returns the amount of space taken by fuel in a CargoAPI. Parameters: cargo: The CargoAPI to analyze. Returns: The amount of space taken by fuel in cargo. Since: 1.0 ``` -------------------------------- ### APIDOC: Get Space Taken By Supplies Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the amount of space taken by supplies in a CargoAPI object. ```APIDOC getSpaceTakenBySupplies(cargo: CargoAPI): float Description: Returns the amount of space taken by supplies in a CargoAPI. Parameters: cargo: The CargoAPI to analyze. Returns: The amount of space taken by supplies in cargo. Since: 1.0 ``` -------------------------------- ### LazyLib getInfo Method Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/LazyLib.html Provides a String containing general information about the LazyLib library. This can be used for displaying startup messages, logging, or other informational purposes. ```APIDOC public static String getInfo() Returns: A String containing information on the library. Since: 1.2 ``` -------------------------------- ### APIDOC: Get Space Taken By Crew Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the amount of space taken by crew in a CargoAPI object. ```APIDOC getSpaceTakenByCrew(cargo: CargoAPI): float Description: Returns the amount of space taken by crew in cargo. Parameters: cargo: The CargoAPI to analyze. Returns: The amount of space taken by crew in cargo. Since: 1.0 ``` -------------------------------- ### SimpleEntity Constructor (WeaponAPI) Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Creates a `CombatEntityAPI` that mimics the location of a `WeaponAPI`. ```APIDOC Class: org.lazywizard.lazylib.combat.entities.SimpleEntity Constructor: SimpleEntity(com.fs.starfarer.api.combat.WeaponAPI weapon) weapon: The weapon to mimic. ``` -------------------------------- ### DefenseUtils Class Source: https://github.com/lazywizard/lazylib/blob/master/docs/allclasses-index.html Contains methods to make working with a ship's armor grid and defenses easier. ```APIDOC class DefenseUtils Description: Contains methods to make working with a ship's armor grid and defenses easier. ``` -------------------------------- ### API: Get Nearest Hostile Fleet Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CampaignUtils.html Finds the closest hostile CampaignFleetAPI to a given SectorEntityToken. ```APIDOC Method: getNearestHostileFleet(token: SectorEntityToken) Description: Find the closest hostile fleet to a SectorEntityToken. Returns: float Parameters: token: SectorEntityToken ``` -------------------------------- ### Get Focus Object in EllipticalOrbit API Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Returns the object that the EllipticalOrbit instance is currently orbiting around. ```APIDOC EllipticalOrbit.getFocus() ``` -------------------------------- ### CombatUtils Uses Bin-Lattice System Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt Methods within `CombatUtils` have been updated to leverage `CombatEngineAPI`'s bin-lattice system where applicable. This change was requested by modders and improves performance for certain combat-related calculations. ```APIDOC org.lazywizard.lazylib.CombatUtils: - Change: Updated to use CombatEngineAPI's bin-lattice system where applicable ``` -------------------------------- ### Java ModPlugin: onApplicationLoad Method Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/LazyLib.html Documents the `onApplicationLoad` method, part of the Starfarer API's `ModPlugin` interface. This method is called during application load and is crucial for mod initialization. It overrides a method in `BaseModPlugin` and can throw a general `Exception`. ```APIDOC public void onApplicationLoad() throws Exception Description: Specified by: onApplicationLoad in interface ModPlugin Overrides: onApplicationLoad in class BaseModPlugin Throws: java.lang.Exception ``` -------------------------------- ### API: Get Faction Relation Between Entities Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CampaignUtils.html Returns the faction relationship level between two SectorEntityToken objects. ```APIDOC Method: getRelation(token1: SectorEntityToken, token2: SectorEntityToken) Description: Returns the faction relationship between two campaign objects. Returns: RepLevel Parameters: token1: SectorEntityToken token2: SectorEntityToken ``` -------------------------------- ### Page Initialization Variables and Script Loading Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.LazyChar.html Initializes CSS class names for table rows and tabs, defines the root path, and loads necessary scripts for the documentation page's interactive elements. ```JavaScript var evenRowColor = "even-row-color"; var oddRowColor = "odd-row-color"; var tableTab = "table-tab"; var activeTableTab = "active-table-tab"; var pathtoroot = "../../../../"; loadScripts(document, 'script'); ``` -------------------------------- ### Get Weapon of SimpleEntity Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Returns the WeaponAPI instance this entity is attached to, if any. This method is useful for entities that can be associated with a weapon. ```APIDOC SimpleEntity.getWeapon() ``` -------------------------------- ### Get collision radius of AnchoredEntity Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Retrieves the collision radius of an AnchoredEntity. This method is currently non-functional and serves as a placeholder. ```APIDOC AnchoredEntity.getCollisionRadius() Returns: float - The collision radius. (NONFUNCTIONAL/PLACEHOLDER) ``` -------------------------------- ### APIDOC: LazyFont Method Summary Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.html This section outlines the key methods available in `LazyFont`, including their return types, names, parameters, and descriptions. Methods cover functionalities such as calculating text width, building strings to fit specific limits, and creating `LazyFont.DrawableString` instances. ```APIDOC Methods: - buildUntilLimit(String rawLine, float fontSize, float maxWidth): String Description: Returns the longest String that will fit within a single line, given the space limits passed in. - calcWidth(String rawLine, float fontSize): float Description: Returns the raw width of a String at a specific font size, without taking into account word wrapping. - createText(): LazyFont.DrawableString Description: Create a LazyFont.DrawableString with no text, ready for appending. - createText(String text): LazyFont.DrawableString Description: Create a LazyFont.DrawableString with the specified initial text. ``` -------------------------------- ### Get Nearest Objective for Combat Entity Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/AIUtils.html Find the closest BattleObjectiveAPI to an entity. This method returns a ShipAPI object. ```APIDOC static com.fs.starfarer.api.combat.ShipAPI getNearestObjective(com.fs.starfarer.api.combat.CombatEntityAPI entity) ``` -------------------------------- ### API Documentation for StringUtils Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt Introduces `org.lazywizard.lazylib.StringUtils`, a new utility class for string manipulation. It provides methods for wrapping strings to a maximum line length and indenting strings with a specified prefix. ```APIDOC org.lazywizard.lazylib.StringUtils: - wrapString(String toWrap, int maxLineLength) - indent(String toIndent, String indentWith) ``` -------------------------------- ### Get Nearest Ally for Combat Entity Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/AIUtils.html Find the closest ally of an entity. This method returns a ShipAPI object. ```APIDOC static com.fs.starfarer.api.combat.ShipAPI getNearestAlly(com.fs.starfarer.api.combat.CombatEntityAPI entity) ``` -------------------------------- ### API Documentation for org.lazywizard.lazylib.campaign.orbits Package Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/orbits/package-summary.html Detailed API documentation for the org.lazywizard.lazylib.campaign.orbits Java package, including its purpose, related packages, and a list of classes with their descriptions. ```APIDOC Package: org.lazywizard.lazylib.campaign.orbits Description: Contains implementations of OrbitAPI. Related Packages: - Package: org.lazywizard.lazylib.campaign Description: Contains campaign helper classes. Classes: - Class: EllipticalOrbit Description: Represents an elliptical orbit path. ``` -------------------------------- ### FontException Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/FontException.html Comprehensive API documentation for the `org.lazywizard.lazylib.ui.FontException` class, detailing its inheritance hierarchy, implemented interfaces, class description, and available constructors. ```APIDOC Package: org.lazywizard.lazylib.ui Class: FontException Extends: java.lang.Exception Implements: java.io.Serializable Description: Thrown if LazyFont.loadFont(String) encounters an error loading or parsing a bitmap font. Since: 2.3 Author: LazyWizard Constructors: FontException(String message) FontException(String message, Throwable cause) FontException(Throwable cause) Methods Inherited: From class java.lang.Throwable ``` -------------------------------- ### Get Orbital Period (Java API) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/orbits/EllipticalOrbit.html Retrieves the orbital period of the entity. This method is specified by the OrbitAPI interface. ```APIDOC Method Name: getOrbitalPeriod Signature: public float getOrbitalPeriod() Returns: float Notes: Specified by: getOrbitalPeriod in interface OrbitAPI ``` -------------------------------- ### APIDOC: Get Space Taken By Cargo Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the total amount of space taken by all cargo types in a CargoAPI object. ```APIDOC getSpaceTakenByCargo(cargo: CargoAPI): float Description: Returns the amount of space taken by all cargo types in a CargoAPI. Parameters: cargo: The CargoAPI to analyze. Returns: The amount of space used in cargo. Since: 1.2 ``` -------------------------------- ### SimpleEntity Constructor (Vector2f) Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Creates a `CombatEntityAPI` that stays in a single, predefined location. ```APIDOC Class: org.lazywizard.lazylib.combat.entities.SimpleEntity Constructor: SimpleEntity(org.lwjgl.util.vector.Vector2f location) location: The predefined location for the entity. ``` -------------------------------- ### ModUtils Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ModUtils.html Comprehensive API documentation for the `ModUtils` class, detailing its static methods for interacting with mod-level functionalities such as checking mod enablement, retrieving mod IDs, and dynamically loading classes based on presence. ```APIDOC Class: org.lazywizard.lazylib.ModUtils Extends: java.lang.Object Description: Contains methods for dealing with mod level (non-gameplay) tasks. Since: 1.9b Author: LazyWizard Methods: - getEnabledModIds(): List Description: Returns the IDs of all currently enabled mods. Parameters: None - getOverrides(): List Description: Returns all vanilla files that have been explicitly overridden in a mod's mod_info.json. Parameters: None - isClassPresent(classCanonicalName: String): boolean Description: Checks if a class is present within the loaded mods. Parameters: - classCanonicalName: String - The canonical name of the class to check. - isModEnabled(modId: String): boolean Description: Check if a mod is enabled. Parameters: - modId: String - The ID of the mod to check. - loadClassesIfClassIsPresent(classCanonicalName: String, classesToLoadCanonicalNames: List, initializeClasses: boolean): boolean Description: Loads a List of classes if a specific class is present, optionally initializing them in the process. Parameters: - classCanonicalName: String - The canonical name of the class to check for presence. - classesToLoadCanonicalNames: List - A list of canonical names of classes to load. - initializeClasses: boolean - Whether to initialize the classes after loading. ``` -------------------------------- ### Get Space Taken by Crew in Cargo Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CargoUtils.html Returns the total amount of space consumed by crew within a specified CargoAPI. ```APIDOC public static float getSpaceTakenByCrew(CargoAPI cargo) cargo: The CargoAPI to analyze. ``` -------------------------------- ### Get entities with a specific tag and faction in a location Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CampaignUtils.html Find all entities with a specific tag and faction within a location. ```APIDOC static java.util.List getEntitiesFromFaction(com.fs.starfarer.api.campaign.LocationAPI location, java.lang.String entityTag, com.fs.starfarer.api.campaign.FactionAPI faction) ``` -------------------------------- ### LazyLib 1.2: FleetUtils, MathUtils, CombatUtils, Removals Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt Version 1.2 introduces a greatly expanded FleetUtils class, equivalent to AIUtils but for CampaignFleetAPIs. MathUtils gains clampAngle() for angle normalization, and CombatUtils adds applyForce() for basic physics. The internal DefenseType and Line classes have been removed. ```APIDOC FleetUtils: Greatly expanded (equivalent to AIUtils but for CampaignFleetAPIs) MathUtils: - clampAngle(): Normalizes angle between 0 and 360 degrees CombatUtils: - applyForce(): Basic implementation of Newton's Second Law Removed DefenseType and Line classes (unused internal data types) ``` -------------------------------- ### Get Shortest Rotation Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/MathUtils.html Calculates the shortest angular distance and direction required to rotate from a current angle to a destination angle. ```APIDOC static float getShortestRotation(float currAngle, float destAngle) Returns the direction and length of the quickest rotation between two angles. ``` -------------------------------- ### AnchoredEntity Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Comprehensive API documentation for the `org.lazywizard.lazylib.combat.entities.AnchoredEntity` class, detailing its inheritance, implemented interfaces, fields, constructors, and methods. ```APIDOC Class: org.lazywizard.lazylib.combat.entities.AnchoredEntity Extends: java.lang.Object Implements: com.fs.starfarer.api.combat.CombatEntityAPI Description: An implementation of CombatEntityAPI that follows and rotates with another anchoring CombatEntityAPI. Since: 1.5 Author: LazyWizard Fields: - Name: anchor Type: protected com.fs.starfarer.api.combat.CombatEntityAPI Description: (No description provided) - Name: relativeAngle Type: protected float Description: (No description provided) - Name: relativeDistance Type: protected float Description: (No description provided) Constructors: - Name: AnchoredEntity Parameters: - Name: anchor Type: com.fs.starfarer.api.combat.CombatEntityAPI - Name: location Type: org.lwjgl.util.vector.Vector2f Description: Creates a CombatEntityAPI that follows and rotates with another anchoring CombatEntityAPI. Methods: - Name: getAI Return Type: java.lang.Object Parameters: None Description: _NONFUNCTIONAL/PLACEHOLDER_ - Name: getAnchor Return Type: com.fs.starfarer.api.combat.CombatEntityAPI Parameters: None Description: Returns the CombatEntityAPI this entity is anchored to. - Name: getAngularVelocity Return Type: float Parameters: None Description: _NONFUNCTIONAL/PLACEHOLDER_ - Name: getCollisionClass Return Type: com.fs.starfarer.api.combat.CollisionClass Parameters: None Description: _NONFUNCTIONAL/PLACEHOLDER_ - Name: getCollisionRadius Return Type: float Parameters: None Description: _NONFUNCTIONAL/PLACEHOLDER_ - Name: getCustomData Return Type: java.util.Map Parameters: None Description: _NONFUNCTIONAL/PLACEHOLDER_ - Name: getExactBounds Return Type: com.fs.starfarer.api.combat.BoundsAPI Parameters: None Description: (No description provided) ``` -------------------------------- ### org.lazywizard.lazylib Package Summary Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Overview of the `org.lazywizard.lazylib` package, which contains general utility methods for non-API data types. ```APIDOC Package: org.lazywizard.lazylib Description: Contains general methods that mostly help with non-API data types. ``` -------------------------------- ### Get Shield (Java APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Retrieves the shield component of an AnchoredEntity. Note: This method is currently non-functional and serves as a placeholder. ```APIDOC AnchoredEntity: Method: getShield() Type: Method Description: _NONFUNCTIONAL/PLACEHOLDER_ Parameters: [] Returns: ShieldAPI ``` -------------------------------- ### MessageUtils Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/MessageUtils.html Comprehensive API documentation for the org.lazywizard.lazylib.campaign.MessageUtils class, detailing its purpose, fields, and methods for formatted message output. ```APIDOC Package: org.lazywizard.lazylib.campaign Class: MessageUtils Extends: java.lang.Object Description: Allows formatted, multi-line, word-wrapped sector messages. Since: 1.0 Author: LazyWizard Fields: LINE_LENGTH: Modifier and Type: static final int Description: How long a line can be before being split by showMessage(java.lang.String). Detail: This is hardcoded to a number that still looks good at very low resolutions. If you wish to have a different message length, you can use StringUtils.wrapString(java.lang.String, int) then output the results. Methods: showMessage(String message): Modifier and Type: static void Parameters: message: String - The text to format and output. Description: Formats and word-wraps the supplied text, then outputs it as a sector message. showMessage(String preamble, String message, boolean indentMessage): Modifier and Type: static void Parameters: preamble: String - Text to prepend to the message. message: String - The text to format and output. indentMessage: boolean - Whether to indent the message. Description: Formats and word-wraps the supplied text, then outputs it as a sector message. Methods inherited from class java.lang.Object: clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(long), wait(long, int) ``` -------------------------------- ### Get Font Size from DrawableString API Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Indicates the size at which the text will be rendered when drawn, useful for layout and scaling operations. ```APIDOC LazyFont.DrawableString.getFontSize() ``` -------------------------------- ### org.lazywizard.lazylib.ui Package Overview Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/package-use.html Describes the purpose of the org.lazywizard.lazylib.ui package, which contains classes and methods for rendering text and simple GUI elements. ```APIDOC Package: org.lazywizard.lazylib.ui Description: Contains classes and methods for rendering text and simple GUI elements. ``` -------------------------------- ### Get custom data of AnchoredEntity Source: https://github.com/lazywizard/lazylib/blob/master/docs/index-all.html Retrieves custom data associated with an AnchoredEntity. This method is currently non-functional and serves as a placeholder. ```APIDOC AnchoredEntity.getCustomData() Returns: Object - Custom data. (NONFUNCTIONAL/PLACEHOLDER) ``` -------------------------------- ### Get Current Font Size Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/ui/LazyFont.DrawableString.html Returns the font size at which the text will be drawn. This indicates the current rendering size applied to the DrawableString. ```APIDOC public float getFontSize() Returns: float - The font size of this LazyFont.DrawableString. Since: 2.3 ``` -------------------------------- ### SimpleEntity Class Constructors Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/SimpleEntity.html Constructors for the SimpleEntity class, used to create a CombatEntityAPI that mimics the location of a WeaponAPI or ShipEngineControllerAPI.ShipEngineAPI. ```APIDOC SimpleEntity(weapon: WeaponAPI) Description: Creates a CombatEntityAPI that mimics the location of a WeaponAPI. Parameters: weapon: WeaponAPI - The WeaponAPI whose location getLocation() should return. Since: 1.7 ``` ```APIDOC SimpleEntity(engine: ShipEngineControllerAPI.ShipEngineAPI) Description: Creates a CombatEntityAPI that mimics the location of a ShipEngineControllerAPI.ShipEngineAPI. Parameters: engine: ShipEngineControllerAPI.ShipEngineAPI - The ShipEngineControllerAPI.ShipEngineAPI whose location getLocation() should return. Since: 1.9b ``` -------------------------------- ### Get Owner of Combat Entity API Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Retrieves the owner ID of the entity. This method is currently non-functional and serves as a placeholder. ```APIDOC public int getOwner() Status: NONFUNCTIONAL/PLACEHOLDER ``` -------------------------------- ### IOUtils Class API Reference Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/IOUtils.html Comprehensive API documentation for the IOUtils class, including its purpose, inheritance, and available methods. This class is designed to handle file I/O operations within specific classloader constraints, such as those found in game development environments. ```APIDOC Class: IOUtils Package: org.lazywizard.lazylib Extends: java.lang.Object Description: Contains classes for reading and writing files within the game's classloader restrictions. Since: 2.6 Author: LazyWizard Methods: readAllBytes(java.lang.String filePath) Modifier and Type: static byte[] Description: This is a port of Files.readAllBytes(Path) that has been modified to work within the game's classloader restrictions. Parameters: filePath: The local file path of the file to read. Returns: The contents of the file at filePath as a byte array. Throws: java.io.IOException Since: 2.6 ``` -------------------------------- ### Get Facing of Combat Entity API Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Retrieves the facing angle of the entity. This method is currently non-functional and serves as a placeholder. ```APIDOC public float getFacing() Status: NONFUNCTIONAL/PLACEHOLDER ``` -------------------------------- ### API: WeaponUtils Class (org.lazywizard.lazylib.combat) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/package-summary.html Documents the `WeaponUtils` class, which contains methods that deal with weapons and weapon arcs. ```APIDOC class WeaponUtils ``` -------------------------------- ### Get Entity Velocity (APIDOC) Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html Returns the velocity of this entity's anchor (and by definition this entity's velocity as well). ```APIDOC Vector2f getVelocity() ``` -------------------------------- ### CombatEntityAPI Interface Method Definitions Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/entities/AnchoredEntity.html This snippet provides the API documentation for various methods belonging to the `CombatEntityAPI` interface. Each method includes its full signature, a note on its current functionality (marked as '_NONFUNCTIONAL/PLACEHOLDER_'), and the interface it specifies. ```APIDOC Interface: CombatEntityAPI Methods: public float getMaxHitpoints() Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.getMaxHitpoints() public void setCollisionRadius(float arg0) Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.setCollisionRadius(float) public Object getAI() Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.getAI() public boolean isExpired() Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.isExpired() public void setCustomData(String s, Object o) Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.setCustomData(java.lang.String, java.lang.Object) public void removeCustomData(String s) Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.removeCustomData(java.lang.String) public Map getCustomData() Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.getCustomData() public void setHitpoints(float hitpoints) Description: _NONFUNCTIONAL/PLACEHOLDER_ Specified by: CombatEntityAPI.setHitpoints(float) ``` -------------------------------- ### CombatUtils: Viewport Centering Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt Introduced a method to programmatically center the game viewport to a new `Vector2f` position during combat. ```APIDOC void centerViewport(Vector2f newCenter) ``` -------------------------------- ### Get Nearest Enemy for Combat Entity Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/combat/AIUtils.html Find the closest visible enemy of an entity. This method returns a MissileAPI object. ```APIDOC static com.fs.starfarer.api.combat.MissileAPI getNearestEnemy(com.fs.starfarer.api.combat.CombatEntityAPI entity) ``` -------------------------------- ### Get the nearest hostile fleet Source: https://github.com/lazywizard/lazylib/blob/master/docs/org/lazywizard/lazylib/campaign/CampaignUtils.html This method is used to retrieve the nearest hostile fleet. Further details are not provided in the current documentation. ```APIDOC public static getNearestHostileFleet ``` -------------------------------- ### CombatUtils: Combat Engine Access Update Source: https://github.com/lazywizard/lazylib/blob/master/mod/changelog.txt All usages of CombatUtils.getCombatEngine() have been replaced with Global.getCombatEngine(). This change standardizes access to the combat engine across the library. ```APIDOC CombatUtils: Swapped usages of CombatUtils.getCombatEngine() to Global.getCombatEngine() ```