using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CustomNPCFramework.Framework.Graphics { public class AssetInfo { public string name; public Vector2 assetSize; public bool randomizeUponLoad; /// /// A constructor use to create asset info which can then be used to create asset sheets. /// /// The name of the texture sheet. Can be different than the actual file name. /// The size of the individual sprites on the texture sheet. Ex 16x16 pixels. /// If true, the index for the asset will be randomized. Good for getting variation from a texture. public AssetInfo(string name, Vector2 assetSize, bool randomizeUponLoad) { this.name = name; 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); } } }