diff --git a/StructureHelper.csproj b/StructureHelper.csproj index ea22712..a6c18d8 100644 --- a/StructureHelper.csproj +++ b/StructureHelper.csproj @@ -5,11 +5,13 @@ StructureHelper latest true + true + $(AssemblyName).xml - + \ No newline at end of file diff --git a/StructureHelper.xml b/StructureHelper.xml new file mode 100644 index 0000000..080d931 --- /dev/null +++ b/StructureHelper.xml @@ -0,0 +1,1512 @@ + + + + StructureHelper + + + + + In this class you will find various utilities related to generating structures and getting important + information from them such as their dimensions. + + + + + Helper to check bounds on a generation call. You can also use this to check the bounds + of your own structure + + The StructureData to check + The position to check from, this would be the top-left of the structure. + If the structure is in bounds or not + + + + Helper to check bounds on a generation call. You can also use this to check the bounds + of your own structure + + The path to search for the structure file + The mod to search for the structure file in + The position to check from, this would be the top-left of the structure. + If the structure is in bounds or not + + + + Gets the dimensions (width and height) of a structure. + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + + + + + Gets the StructureData for a given path in a given mod (or absolute path if fullPath is true). + Will attempt to retrieve from the StructureData cache first if possible before doing I/O + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + The StructureData associated with the desired file + + + + + This method generates a structure from a structure file. + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The position in the world to place the top-left of the structure, in tile coordinates. + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + + + + Directly generates a given StructureData into the world. Use this directly if you have + a StructureData object in memory you want to generate from. + + The StructureData to generate + The position in the world to place the top-left of the structure, in tile coordinates. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + + + + A static class providing utilities to generate structures. + + + + + This method generates a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + This method generates a structure selected randomly from a multistructure file within your mod. + + The path to your multistructure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll refference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + This method generates a structure you select from a multistructure file within your mod. Useful if you want to do your own weighted randomization or want additional logic based on dimensions gotten from GetMultistructureDimensions. + + The path to your multistructure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + The index of the structure you want to generate out of the multistructure file, structure indicies are 0-based and match the order they were saved in. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll refference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + Helper to check bounds on a generation call + + The tag to check + The position to check from + If the structure is in bounds or not + + + + Gets the dimensions of a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The instance of your mod to grab the file from. + The Point16 variable which you want to be set to the dimensions of the structure. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + + + + + Gets the dimensions of a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The instance of your mod to grab the file from. + The index of the structure you want to get the dimensions of out of the multistructure file, structure indicies are 0-based and match the order they were saved in. + The Point16 variable which you want to be set to the dimensions of the structure. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + + + + + Checks if a structure file is a multistructure or not. Can be used to easily add support for parameterizing strucutres or multistructures in your mod. + + The path to the structure file you wish to check. + The instance of your mod to grab the file from. + True if the file is a multistructure, False if the file is a structure, null if it is invalid. + + + + Gets the quantity of structures in a multistructure file if possible. Returns null if the structure is invalid or not a multistructure. + + The path to the structure file you wish to check. + The instance of your mod to grab the file from. + The amount of structures in a multistructure, or null if invalid. + + + + Parses and generates the actual tiles from a structure file + + The structure data TagCompound to generate from + The position in the world of the top-leftmost tile to be placed at + If this structure should place null tiles or not + If the structure successfully generated or not + + + + Places a chest in the world and fills it according to a set of chest rules + + The position of the top-leftmost corner of the chest + The TagCompound containing the chest rules you want to generate your chest with + + + + Loads and caches a structure file. + + The path to the struture file to load + The mod to load the structure file from + If the given path is fully qualified + If the file could successfully be loaded or not + + + + Attempts to get data from a structure/multistructure file. If the data is not cached, it will be loaded and cached. + + The path of the file to retrieve data from + The mod to load the structure file from + If the given path is fully qualified + The TagCompound containing the structure/multistructure data + + + + A static class providing utilities for saving structures. + + + + + Saves a given region of the world as a structure file + + The region of the world to save, in tile coordinates + The name of the file to save. Automatically defaults to a file named after the date in the SavedStructures folder + + + + Saves a given list of TagCompounds together as a multistructure file + + The tags to save + The name of the file to save. Automatically defaults to a file named after the date in the SavedStructures folder + + + + Transforms a region of the world into a structure TagCompound. Must be called in an unsafe context! + + The region to transform + The TagCompound that can be saved to a structure file + + + + In this class you will find various utilities related to generating multi structures and getting important + information from them such as their dimensions or structure count. + + + + + Helper to check bounds on a generation call. You can also use this to check the bounds + of your own structure + + The MultiStructureData to check + The position to check from, this would be the top-left of the structure. + The index in the multistructure to check the dimensions of. + If the structure is in bounds or not + + + + Helper to check bounds on a generation call. You can also use this to check the bounds + of your own structure + + The path to search for the multi structure file + The mod to search for the multi structure file in + The position to check from, this would be the top-left of the structure. + The index in the multistructure to check the dimensions of. + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + If the structure is in bounds or not + + + + Gets the dimensions (width and height) of a structure in a multistructure. + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The mod to search for the structure file in + The index in the multistructure to check the dimensions of. + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + + + + + Gets the amount of structures inside of a multi structure file + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + + + + + Gets the MultiStructureData for a given path in a given mod (or absolute path if fullPath is true). + Will attempt to retrieve from the MultiStructureData cache first if possible before doing I/O + + The path to search for the multi structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The mod to search for the multi structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + The MultiStructureData associated with the desired file + + + + + This method generates a random structure from a multi structure file. + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The position in the world to place the top-left of the structure, in tile coordinates. + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + + + + Generates a specific structure from a multi structure file + + The path to search for the structure file. If it is in a mod, it should not include the mods name (for example, it should be "structures/coolHouse", not "CoolHouseMod/structures/coolHouse") + The index of the structure to generate out of the multistructure + The position in the world to place the top-left of the structure, in tile coordinates. + The mod to search for the structure file in + If the search path starts at the root of your file system(true) or the provided mod(false). This should usually be false. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + + + + + In this class you will find utilities for saving regions of the world into structure data, + and then saving that data into files if needed. + + + + + Saves a region of the world into a StructureData object. + + The leftmost point of the region + The topmost point of the region + The width of the region + The height of the region + a StructureData object representing that region of the world + If any part of the region is outside of the world + + + + Saves a region of the world into a StructureData object, including the specified custom ITileData types. + + The leftmost point of the region + The topmost point of the region + The width of the region + The height of the region + The types of ITileData to save in addition to vanilla ITileData. These should all be blittable ITileData types. + a StructureData object representing that region of the world + If any part of the region is outside of the world + + + + Saves a given StructureData to a file, the location is by the target path, and with the given name. + + The StructureData to save + The path to the directory save the file into + The name of the file, NOT including the extension + + + + Saves a given MultiStructureData to a file, the location is by the target path, and with the given name. + + The MultiStructureData to save + The path to the directory save the file into + The name of the file, NOT including the extension + + + + the chance for any individual item from this pool to generate, from 0 to 1. (0 = 0%, 1 = 100%) If you want to generate X items from the pool, use ChestRulePool instead. If you want multiple different chances, add another rule of this type. + + + + + How many items from the pool, picked at random, should be placed in the chest. + + + + + How many items from the pool, picked at random, should be placed in the chest. + + + + + the chance for this item pool to generate at all. + + + + + A UI element for changing the value of 'something'. + + + + + The name that gets displated above the panel to the user + + + + + The info sown when hovering over this panel + + + + + The current value this editor believes the field its tied to to have. This wont update in real time so be careful + + + + + The callback that should happen when this editor thinks the value its tracking has changed. You'll likely need to cast the object parameter to the correct type. + + + + + This function, called every frame while the editor is not being used, is used to update the editor's value to the current value of the tracked value. + + + + + If this editor is currently being used to change a value, and thus shouldn't listen for update + + + + + + + Height of the panel + The name that gets displated above the panel to the user + The callback that should happen when this editor thinks the value its tracking has changed. You'll likely need to cast the object parameter to the correct type. + A hint for what the initial value of the field tracked by this editor is + + + + Defines what should happen when a new value is recieved from the value update listener. Note that value has not yet been updated when this is called, so you can compare to the old value. + + The new value that was recieved + + + + Loads all structure files and generates elements to be clicked for them + + + + + Draws the popup tooltip when various elements of the UI are hovered over. + + + + + Sets the brightly colored main line of the tooltip. This should be a short descriptor of what you're hovering over, like its name + + + + + + Sets the more dimly colored 'description' of the tooltip. This should be the 'body' of the tooltip. + + + + + + What happens when you right click after a finazed rectangle is present + + + + + Wrapper class that enforces Safe interoperability between event listeners and virtual methods for UI elements + + + + + A Safe wrapper around XButton1MouseUp that allows both an override and the OnXButton1MouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1MouseDown that allows both an override and the OnXButton1MouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1Click that allows both an override and the OnXButton1Click event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1DoubleClick that allows both an override and the OnXButton1DoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2MouseUp that allows both an override and the OnXButton2MouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2MouseDown that allows both an override and the OnXButton2MouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2Click that allows both an override and the OnXButton2Click event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2DoubleClick that allows both an override and the OnXButton2DoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseUp that allows both an override and the OnMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseDown that allows both an override and the OnMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around Click that allows both an override and the OnClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around DoubleClick that allows both an override and the OnDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightMouseUp that allows both an override and the OnRightMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightMouseDown that allows both an override and the OnRightMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightClick that allows both an override and the OnRightClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightDoubleClick that allows both an override and the OnRightDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleMouseUp that allows both an override and the OnMiddleMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleMouseDown that allows both an override and the OnMiddleMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleClick that allows both an override and the OnMiddleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleDoubleClick that allows both an override and the OnMiddleDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseOver that allows both an override and the OnMouseOver event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around Update that allows both an override and the OnUpdate event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around ScrollWheel that allows both an override and the OnScrollWheel event to be used together + + The mouse event that occured to fire this listener + + + + An auto-loaded UI State, that knows information about its own visibility. + + + + + The UserInterface automatically assigned to this UIState on load. + + + + + Where this UI state should be inserted relative to the vanilla UI layers. + + The vanilla UI layers + The insertion index of this UI state + + + + If the UI should be visible and interactable or not + + + + + What scale setting this UI should scale with + + + + + Allows you to unload anything that might need to be unloaded + + + + + Appends an element to this state with the given dimensions + + The element to append + The x position in pixels + The y position in pixels + The width in pixels + The height in pixels + + + + Appends an element to another element with the given dimensions + + The element to append + The x position in pixels + The y position in pixels + The width in pixels + The height in pixels + The element to append to + + + + Appends an element to this state with the given dimensions + + The element to append + The x position in pixels + The x position in percentage of the parents width + The y position in pixels + The y position in percentage of the parents height + The width in pixels + The width in percentage of the parents width + The height in pixels + The height in percentage of the parents height + + + + Appends an element to this state with the given dimensions + + The element to append + The x position in pixels + The x position in percentage of the parents width + The y position in pixels + The y position in percentage of the parents height + The width in pixels + The width in percentage of the parents width + The height in pixels + The height in percentage of the parents height + The element to append to + + + + A Safe wrapper around XButton1MouseUp that allows both an override and the OnXButton1MouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1MouseDown that allows both an override and the OnXButton1MouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1Click that allows both an override and the OnXButton1Click event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton1DoubleClick that allows both an override and the OnXButton1DoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2MouseUp that allows both an override and the OnXButton2MouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2MouseDown that allows both an override and the OnXButton2MouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2Click that allows both an override and the OnXButton2Click event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around XButton2DoubleClick that allows both an override and the OnXButton2DoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseUp that allows both an override and the OnMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseDown that allows both an override and the OnMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around Click that allows both an override and the OnClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around DoubleClick that allows both an override and the OnDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightMouseUp that allows both an override and the OnRightMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightMouseDown that allows both an override and the OnRightMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightClick that allows both an override and the OnRightClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around RightDoubleClick that allows both an override and the OnRightDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleMouseUp that allows both an override and the OnMiddleMouseUp event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleMouseDown that allows both an override and the OnMiddleMouseDown event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleClick that allows both an override and the OnMiddleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MiddleDoubleClick that allows both an override and the OnMiddleDoubleClick event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around MouseOver that allows both an override and the OnMouseOver event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around Update that allows both an override and the OnUpdate event to be used together + + The mouse event that occured to fire this listener + + + + A Safe wrapper around ScrollWheel that allows both an override and the OnScrollWheel event to be used together + + The mouse event that occured to fire this listener + + + + Automatically loads SmartUIStates ala IoC. + + + + + The collection of automatically craetaed UserInterfaces for SmartUIStates. + + + + + The collection of all automatically loaded SmartUIStates. + + + + + Uses reflection to scan through and find all types extending SmartUIState that arent abstract, and loads an instance of them. + + + + + Helper method for creating and inserting a LegacyGameInterfaceLayer automatically + + The vanilla layers + the UIState to bind to the layer + Where this layer should be inserted + The logic dictating the visibility of this layer + The scale settings this layer should scale with + + + + Handles updating the UI states correctly + + + + + + Gets the autoloaded SmartUIState instance for a given SmartUIState subclass + + The SmartUIState subclass to get the instance of + The autoloaded instance of the desired SmartUIState + + + + Forcibly reloads a SmartUIState and it's associated UserInterface + + The SmartUIState subclass to reload + + + + Handles the insertion of the automatically generated UIs + + + + + + Registers a custom ITileData type to be able to be enabled for structure saving. + After you do this to save your custom data you will need to enable it in-game using + the data configurator tool. + + The type to register. This should extend ITileData + An instance of your mod + + + + + The legacy API left as is to prevent runtime breakage. + + + + + This method generates a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll reference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + This method generates a structure selected randomly from a multistructure file within your mod. + + The path to your multistructure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll refference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + This method generates a structure you select from a multistructure file within your mod. Useful if you want to do your own weighted randomization or want additional logic based on dimensions gotten from GetMultistructureDimensions. + + The path to your multistructure file within your mod - this should not include your mod's folder, only the path beyond it. + The position in the world in which you want your structure to generate, in tile coordinates. + The instance of your mod to grab the file from. + The index of the structure you want to generate out of the multistructure file, structure indicies are 0-based and match the order they were saved in. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + If the structure should repsect the normal behavior of null tiles or not. This should never be true if you're using the mod as a dll refference. + Allows you to pass flags for special generation behavior. See + If the structure generated successfully or not + + + + Gets the dimensions of a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The instance of your mod to grab the file from. + The Point16 variable which you want to be set to the dimensions of the structure. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + + + + + Gets the dimensions of a structure from a structure file within your mod. + + The path to your structure file within your mod - this should not include your mod's folder, only the path beyond it. + The instance of your mod to grab the file from. + The index of the structure you want to get the dimensions of out of the multistructure file, structure indicies are 0-based and match the order they were saved in. + The Point16 variable which you want to be set to the dimensions of the structure. + Indicates if you want to use a fully qualified path to get the structure file instead of one from your mod - generally should only be used for debugging. + + + + + Checks if a structure file is a multistructure or not. Can be used to easily add support for parameterizing strucutres or multistructures in your mod. + + The path to the structure file you wish to check. + The instance of your mod to grab the file from. + True if the file is a multistructure, False if the file is a structure, null if it is invalid. + + + + Gets the quantity of structures in a multistructure file if possible. Returns null if the structure is invalid or not a multistructure. + + The path to the structure file you wish to check. + The instance of your mod to grab the file from. + The amount of structures in a multistructure, or null if invalid. + + + + Parses and generates the actual tiles from a structure file + + The structure data TagCompound to generate from + The position in the world of the top-leftmost tile to be placed at + If this structure should place null tiles or not + If the structure successfully generated or not + + + + Randomizes the order of a list using the Fischer-Yates algorithm + + The type of the list to randomize + The list to randomize + + + + + Draws the outline of a box in the style of the DragonLens GUI. + + the spriteBatch to draw the outline with + where/how big the outline should be drawn + the color of the outline + + + + Gets the inverse of a color. Used for 'constrasting' elements of the StructureHelper GUI, such as outlines indicating something being on. + + the color to invert + the inverted color + + + + Wraps a string to a given maximum width, by forcibly adding newlines. Normal newlines will be removed, put the text 'NEWBLOCK' in your string to break a paragraph if needed. + + The input string to be wrapped + The maximum width of the text + The font the text will be drawn in, to calculate its size + The scale the text will be drawn at, to calculate its size + Input text with linebreaks inserted so it obeys the width constraint. + + + + Uses reflection to forcibly open the TModLoader configuration UI to a given ModConfig's screen. + + The config to open up + + + + Opens a URL in the web browser + + The URL to open to + + + + Gets a localized text value of the mod. + If no localization is found, the key itself is returned. + + the localization key + optional args that should be passed + the text should be displayed + + + + Flags that allow users to define special behavior for structure generation. + + + + + No special generation + + + + + Null tiles will inherit the type of the tile behind them, but keep their slope if that tile is slopable + + + + + Null tiles and walls will inherit the type of the tile/wall behind them, but will keep the paint they are given + + + + + Tile entities will not have their saved data placed in the generated structures, instead falling back to acting as if they are newly created + + + + + A struct representing tile data to be saved/loaded from structure files. + + + + + The tile to be placed, either a number if a vanilla tile (ID), or a fully qualified internal name for modded tiles. + + + + + The wall to be placed, either a number if a vanilla wall (ID), or a fully qualified internal name for modded walls. + + + + + The X frame of a tile + + + + + the Y frame of a tile + + + + + One part of the packed vanilla data about a tile + + + + + The other part of the packed vanilla data about a tile + + + + + Data about certain coatings added by 1.4.4 + + + + + The fully qualiified name of a modded tile entity, if one should exist here + + + + + The data associated with a tile entity associated here + + + + + If the tile here is air or not. (Note that TileID 0 is dirt, this is all that differentiates air and dirt.) + + + + + Deserialize a TagCompound into an instance of this struct + + The tag to interpret + The unpacked TileSaveData + + + + Serialize this struct into a TagCompound for saving + + The packed TagCompound + + + + Represents the contents of a multi structure file in-memory. This object is only valid + for a given mod load instance, as modded tile types will be parsed out from the table + into the body data. If you are storing these and your mod reloads, you should consider + them invalid afterwards. + + + + + The amount of structures in this multistructure + + + + + The structure data in this multistructure + + + + + Constructs a MultiStructureData from raw binary data + + A reader for the raw binary data, such as from a file + A MultiStructureData constructed from the raw bytes + + + + + Generates a MultiStructureData from a list of StructureData + + The StructureData to put into this MultiStructureData + The constructed MultiStructureData containing all elements in the source list + + + + Serialize this MultiStructureData into a binary writer, such as to write to a file + + + + + Represents the contents of a structure file in-memory. This object is only valid + for a given mod load instance, as modded tile types will be parsed out from the table + into the body data. If you are storing these and your mod reloads, you should consider + them invalid afterwards. + + + + + Header text to denote that this binary file is a SH structure + + + + + The width of the structure + + + + + The height of the structure + + + + + If the structure contains NBT data or not + + + + + If the structure contains custom ITileData entries + + + + + The version this structure was saved in. + + + + + Represents the mapping between the stored tile type and the actual ID of the modded tiles. + There is a table of fully qualified names in the structure file that is used to populate + this when it is loaded. + + + + + Represents the mapping between the stored wall type and the actual ID of the modded walls. + There is a table of fully qualified names in the structure file that is used to populate + this when it is loaded. + + + + + Represents columns which contain null tiles or walls. These are slow as we have to copy data + piecemeal to allow those effects to take place instead of copying the entire column as a + memory span + + + + + The actual tile data entries. Each entry represents an ITileData sequence. Vanilla by default + has 5 of these, and mods may add more. + + + + + This represents the NBT component of the structure file, used to store information such as + tile entity data and chest loot pools. + + + + + Processes the tile and wall type data to replace the types with those that should correspond to them + in the current game instance, since those IDs shift with every reload + + + + + Gets the current numeric ID of a tile given its fully qualified name + + The fully qualified name of a modded tile + The current numeric ID of that tile, or 0 (dirt) if it does not exist + + + + Gets the current numeric ID of a wall given its fully qualified name + + The fully qualified name of a modded wall + The current numeric ID of that wall, or 0 (empty) if it does not exist + + + + Attempts to get the Type of an ITileData given a string representing it + + The string for the ITileData + The Type representing the ITileData, or null it not found + + + + Constructs a StructureData from raw binary data + + A reader for the raw binary data, such as from a file + A StructureData constructed from the raw bytes + If the stream does not represent a structure + + + + Internal function used to copy a column of tile data into this StructureData + + The type of the ITileData to copy in + The X position of the column + The topmost point of the column + The column in the data map to insert the data into + The mod the ITileData type is from, or null if vanilla + + + + Internal function used to copy a column of tile data into the world from this StructureData + + The type of the ITileData to copy out + The X position of the column + The topmost point of the column + The column in the data map to insert the data into + The mod the ITileData type is from, or null if vanilla + + + + Exports all data columns, for use when custom ITileData is present so reflection is required + + + + + + + + Internal function used to copy a column of tile data into the world from this StructureData + that may have null blocks or walls in it + + The type of the ITileData to copy out + The X position of the column + The topmost point of the column + The column in the data map to insert the data into + The mod the ITileData type is from, or null if vanilla + + + + Exports all data columns that may have null blocks or walls in it, for use when custom ITileData is present so reflection is required + + + + + + + + Constructs a structure data from a region in the world + + The leftmost point of the region + The topmost point of the region + The width of the region + The height of the region + A StructureData representing the specified world region + + + + Adds custom ITileData from the region of the world, to be called after FromWorld initializes a StructureData + + The leftmost point of the region + The topmost point of the region + The width of the region + The height of the region + A list of custom ITileData types to save + + + + Serialize this StructureData into a binary writer, such as to write to a file + + + + + Represents an NBT entry within the NBT section of the structure file. These are used for sparse, + complex data within structures like tile entities or chest pools. + + You MUST implement a DESERIALIZER as per TagSerializable! + + + + + X coordinate local to the strucure associated with this NBT entry + + + + + Y coordinate local to the structure associated with this NBT entry + + + + + Temporary hack deserializer because TML fails to find subtype deserializers + + + + + What needs to happen on structure generation to properly place the object + represented by this NBT entry into the world. + + + + + Serialize the custom data for this StructureNbtEntry here + + The tag to serialize to + + + + Returns the pointer to the backing data of this TileDataEntry + + + + + + Sets the data for this TileDataEntry from a byte array, such as one read from a binary file + + The raw data to populate this entry with + + + + + Gets the raw data of this tile data entry as a byte array. + + The raw data as a byte array + + + + Gets a single entry at this location in the data. Returns as a void pointer, + you will have to derefference this yourself. + + + + + + + + Returns the raw size of this tile data entry, in bytes. + + The total size of this data entry in bytes + + + + Returns the size in bytes of one column of this data + + + + + + Returns the size in bytes of a single entry of this data + + + + + + Returns the ITileData Type this structure holds + + + + + + Imports a column of data from the world into this structure + + The topmost point of the column + The index of the column to read into + + + + Copies an entire column of data from this data entry into the world. + + The pointer to the topmost tiles ITileData of this type to copy into + The column of data to place at that location + + + + Copies a single entry of data into the world. + + The pointer to the tiles ITileData of this type to copy into + The X position to copy from + The Y position to copy from + + + + Container for a structure's preview image. + + + + + The name of the structure this is previewing + + + + + The actual texture of the preview + + + + + Width of the preview texture, in pixels + + + + + Height of the preview texture, in pixels + + + + + Renders and saves the actual preview to a RenderTarget. + + The texture created + + + + A queue of previews to render textures for when the next opportunity arises + + + + + When the opportunity in the rendering cycle arises, render out all of the queued previews + + + + + + The name of the structure this is previewing + + + + + The actual texture of the preview + + + + + Width of the preview texture, in pixels + + + + + Height of the preview texture, in pixels + + + + + Renders and saves the actual preview to a RenderTarget. + + The texture created + + + + A queue of previews to render textures for when the next opportunity arises + + + + + When the opportunity in the rendering cycle arises, render out all of the queued previews + + + + +