using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CustomNPCFramework.Framework.Graphics { /// /// A class to be used to hold information regarding assets such as the name of the assets and the paths to the images. /// public class AssetInfo { /// /// The name of the asset to be used in the main asset pool. /// public string assetName; /// /// The list of files to be used for the standing animation. /// public NamePairings standingAssetPaths; /// /// The list of files to be used for the swimming animation. /// public NamePairings swimmingAssetPaths; /// /// The list of files to be used with the moving animation. /// public NamePairings movingAssetPaths; /// /// The list of files to be used with the sitting animation. /// public NamePairings sittingAssetPaths; /// /// The size of the asset texture. Width and height. /// public Vector2 assetSize; /// /// Not really used anymore. More of a legacy feature. /// public bool randomizeUponLoad; /// /// Empty constructor. /// public AssetInfo() { } /// /// Constructor that assigns values to the class. /// /// The name of the asset. This is the name that will be referenced in any asset manager or asset pool. /// The name of the files to be used for the standing animation. /// The name of the files to be used for the moving animation. /// The name of the files to be used for the swimming animation. /// The name of the files to be used for the sitting animation. /// The size of the asset. Width and height of the texture. /// Legacy, not really used anymore. public AssetInfo(string assetName,NamePairings StandingAssetPaths, NamePairings MovingAssetPaths, NamePairings SwimmingAssetPaths, NamePairings SittingAssetPaths, Vector2 assetSize, bool randomizeUponLoad) { this.assetName = assetName; this.sittingAssetPaths = SittingAssetPaths; this.standingAssetPaths = StandingAssetPaths; this.movingAssetPaths = MovingAssetPaths; this.swimmingAssetPaths = SwimmingAssetPaths; this.assetSize = assetSize; this.randomizeUponLoad = randomizeUponLoad; } /// /// Save the json to a certain location. /// /// public void writeToJson(string path) { Class1.ModHelper.WriteJsonFile(path, this); } /// /// Read the json from a certain location. /// /// /// public static AssetInfo readFromJson(string path) { return Class1.ModHelper.ReadJsonFile(path); } } }