LoadingBlueprintRepository Class

public sealed class LoadingBlueprintRepository : ScriptableObject

The repository is meant to serve as a tangible reference to a collection of Loading Blueprints, and aids in the inuitive changing of blueprints midgame.

Properties

Name Type Description
NumberOfBlueprints int

Gets the number of blueprints in this repository.

Methods

GetLoadingBlueprintByID(int, out int)

public LoadingBlueprint GetLoadingBlueprintByID(int ID, out int indexOfBlueprintInRepository)

Gets the loading blueprint with the specified ID from this repository.

Parameters

Name Type Description
ID int

The ID of the loading blueprint to get. You can identify this via the repositories inspector. The ID is in parentheses to the right of each Blueprint Type (ID = #).

indexOfBlueprintInRepository int

The index of the loading blueprint within the repository, set after the method returns.

Returns

LoadingBlueprint
The loading blueprint with the ID.

Exceptions

Type Condition
ArgumentException Thrown when the ID does not correspond with a loading blueprint in the repository.

GetLoadingBlueprintByIndex(int)

public LoadingBlueprint GetLoadingBlueprintByIndex(int indexOfBlueprintInRepository)

Gets a loading blueprint stored at the input index within this repository.

Parameters

Name Type Description
indexOfBlueprintInRepository int

The index of the blueprint. The indexes are the numbers you see to the left of each blueprint in the inspector of your repository (1: , 2: , etc. - they are not the IDs!).

Generally speaking, we recommended using either GetLoadingBlueprintByName or GetLoadingBlueprintByID method instead because if you remove a blueprint from a repository, all blueprints after the removed one will have their indexes decremented. If the code calling this method is not changed to reflect these decremented indexes, it's possble the code will expect a different blueprint than it receives.

Returns

Loading Blueprint
The Loading Blueprint at the specified index.

Exceptions

Type Condition
IndexOutOfRangeException Thrown if the index is not valid (less than 1 or greater than the number of blueprints in the respository)
NullReferenceException Thrown if the index points to a null blueprint, which should never happen. If it does, please contact me!!

GetLoadingBlueprintByName(string, out int)

public LoadingBlueprint GetLoadingBlueprintByName(string nameOfBlueprintInRepository, out int indexOfBlueprintInRepository)

Gets the loading blueprint of this repository using the provided name.

Parameters

Name Type Description
nameOfBlueprintInRepository string

The name of the blueprint.

indexOfBlueprintInRepository

The one based index of the blueprint in the repository, which will be set upon method conclusion.

Returns

Loading Blueprint
The Loading Blueprint with the specified name.

Exceptions

Type Condition
InvalidNameException Thrown if the name is not valid.