2018-03-04 23:53:55 +08:00
|
|
|
using System.Collections.Generic;
|
2018-12-30 18:00:05 +08:00
|
|
|
using CustomNPCFramework.Framework.Enums;
|
|
|
|
using Microsoft.Xna.Framework;
|
2018-03-04 23:53:55 +08:00
|
|
|
|
|
|
|
namespace CustomNPCFramework.Framework.Graphics
|
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>An expanded Asset info class that deals with seasons and genders.</summary>
|
|
|
|
public class ExtendedAssetInfo : AssetInfo
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>The genders this part is associated with.</summary>
|
2018-03-04 23:53:55 +08:00
|
|
|
public Genders gender;
|
2018-12-30 18:00:05 +08:00
|
|
|
|
|
|
|
/// <summary>A list of seasons where this part can be displayed.</summary>
|
|
|
|
public List<Seasons> seasons = new List<Seasons>();
|
|
|
|
|
|
|
|
/// <summary>The part type to be used for this asset such as hair, eyes, etc.</summary>
|
2018-03-04 23:53:55 +08:00
|
|
|
public PartType type;
|
2018-12-30 18:00:05 +08:00
|
|
|
|
|
|
|
/// <summary>Construct an instance.</summary>
|
|
|
|
public ExtendedAssetInfo() { }
|
|
|
|
|
|
|
|
/// <summary>Construct an instance.</summary>
|
|
|
|
/// <param name="name">The name of the asset. This is the name that will be referenced in any asset manager or asset pool.</param>
|
|
|
|
/// <param name="standingAssetPaths">The name of the files to be used for the standing animation.</param>
|
|
|
|
/// <param name="movingAssetPaths">The name of the files to be used for the moving animation.</param>
|
|
|
|
/// <param name="swimmingAssetPaths">The name of the files to be used for the swimming animation.</param>
|
|
|
|
/// <param name="sittingAssetPaths">The name of the files to be used for the sitting animation.</param>
|
|
|
|
/// <param name="assetSize">The size of the asset. Width and height of the texture.</param>
|
|
|
|
/// <param name="randomizeOnLoad">Legacy, not really used anymore.</param>
|
|
|
|
/// <param name="gender">The type of gender this asset will be associated with.</param>
|
|
|
|
/// <param name="season">The type of season this asset will be associated with.</param>
|
|
|
|
/// <param name="type">The part type to be used for this asset such as hair, eyes, etc.</param>
|
|
|
|
public ExtendedAssetInfo(string name, NamePairings standingAssetPaths, NamePairings movingAssetPaths, NamePairings swimmingAssetPaths, NamePairings sittingAssetPaths, Vector2 assetSize, bool randomizeOnLoad, Genders gender, List<Seasons> season, PartType type)
|
|
|
|
: base(name, standingAssetPaths, movingAssetPaths, swimmingAssetPaths, sittingAssetPaths, assetSize, randomizeOnLoad)
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
this.gender = gender;
|
|
|
|
this.seasons = season ?? new List<Seasons>();
|
|
|
|
this.type = type;
|
2018-03-04 23:53:55 +08:00
|
|
|
}
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Save the json to a certain location.</summary>
|
2019-01-06 13:31:40 +08:00
|
|
|
/// <param name="relativePath">The relative path to write.</param>
|
|
|
|
public new void writeToJson(string relativePath)
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2019-01-06 13:31:40 +08:00
|
|
|
Class1.ModHelper.Data.WriteJsonFile<ExtendedAssetInfo>(relativePath, this);
|
2018-03-04 23:53:55 +08:00
|
|
|
}
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Read the json from a certain location.</summary>
|
2019-01-06 13:31:40 +08:00
|
|
|
/// <param name="relativePath">The relative path to read.</param>
|
|
|
|
public new static ExtendedAssetInfo readFromJson(string relativePath)
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2019-01-06 13:31:40 +08:00
|
|
|
return Class1.ModHelper.Data.ReadJsonFile<ExtendedAssetInfo>(relativePath);
|
2018-03-04 23:53:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|