using System.Collections.Generic; using CustomNPCFramework.Framework.Enums; using Microsoft.Xna.Framework; namespace CustomNPCFramework.Framework.Graphics { /// An expanded Asset info class that deals with seasons and genders. public class ExtendedAssetInfo : AssetInfo { /// The genders this part is associated with. public Genders gender; /// A list of seasons where this part can be displayed. public List seasons = new List(); /// The part type to be used for this asset such as hair, eyes, etc. public PartType type; /// Construct an instance. public ExtendedAssetInfo() { } /// Construct an instance. /// 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. /// The type of gender this asset will be associated with. /// The type of season this asset will be associated with. /// The part type to be used for this asset such as hair, eyes, etc. public ExtendedAssetInfo(string name, NamePairings standingAssetPaths, NamePairings movingAssetPaths, NamePairings swimmingAssetPaths, NamePairings sittingAssetPaths, Vector2 assetSize, bool randomizeOnLoad, Genders gender, List season, PartType type) : base(name, standingAssetPaths, movingAssetPaths, swimmingAssetPaths, sittingAssetPaths, assetSize, randomizeOnLoad) { this.gender = gender; this.seasons = season ?? new List(); this.type = type; } /// Save the json to a certain location. /// The relative path to write. public new void writeToJson(string relativePath) { Class1.ModHelper.Data.WriteJsonFile(relativePath, this); } /// Read the json from a certain location. /// The relative path to read. public new static ExtendedAssetInfo readFromJson(string relativePath) { return Class1.ModHelper.Data.ReadJsonFile(relativePath); } } }