int ApiVersion { get; set; }

robot_2Generated
code_blocksInput

Description

The ApiVersion property of the Package class is an integer that indicates the API version of the package. This property is crucial for ensuring compatibility between game extensions and the game itself. Extensions targeting a specific game are only compatible if their API versions match. This helps maintain stability and functionality across different versions of the game and its extensions.

Usage

To access the ApiVersion property, you need to have an instance of the Package class. You can then retrieve the API version to check compatibility with the current game version.

Example

// Example of accessing the ApiVersion property
Package myPackage = new Package();
int apiVersion = myPackage.ApiVersion;

// Check if the package is compatible with the current game version
if (apiVersion == currentGameApiVersion)
{
    // Proceed with using the package
}
else
{
    // Handle incompatibility
}