TomlDataReader, documentation updates, move ParticleSystem to Voile.Systems.Particles.
This commit is contained in:
76
Voile/Source/Resources/DataReaders/IDataReader.cs
Normal file
76
Voile/Source/Resources/DataReaders/IDataReader.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace Voile.Resources.DataReaders
|
||||
{
|
||||
/// <summary>
|
||||
/// Reads data from a specified stream.
|
||||
/// </summary>
|
||||
public interface IStreamDataReader
|
||||
{
|
||||
/// <summary>
|
||||
/// Read data from a specified stream.
|
||||
/// </summary>
|
||||
/// <param name="data">Stream with data.</param>
|
||||
void Read(Stream data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates data integrity or schema.
|
||||
/// </summary>
|
||||
public interface IDataValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines if data specified is valid and can be safely read.
|
||||
/// </summary>
|
||||
/// <returns>Returns true if data is valid.</returns>
|
||||
bool Valid();
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets primitive type data from a key/value based format.
|
||||
/// </summary>
|
||||
public interface IStreamKeyValueGetter
|
||||
{
|
||||
/// <summary>
|
||||
/// Get an int from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
int GetInt(string key, int defaultValue = 0);
|
||||
/// <summary>
|
||||
/// Get a long from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
long GetLong(string key, long defaultValue = 0);
|
||||
/// <summary>
|
||||
/// Get a float from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
float GetFloat(string key, float defaultValue = 0.0f);
|
||||
/// <summary>
|
||||
/// Get a double from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
double GetDouble(string key, double defaultValue = 0.0);
|
||||
/// <summary>
|
||||
/// Get a Voile.Color from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
Color GetColor(string key, Color defaultValue);
|
||||
/// <summary>
|
||||
/// Get a System.Numerics.Vector2 from this data getter.
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the value.</param>
|
||||
/// <param name="defaultValue">Default value in case this getter fails to get data.</param>
|
||||
/// <returns></returns>
|
||||
Vector2 GetVector2(string key, Vector2 defaultValue);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user