mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
3.0 - unitypackage
This commit is contained in:
42
Runtime/Internal/Attributes/CoordOptionsAttribute.cs
Normal file
42
Runtime/Internal/Attributes/CoordOptionsAttribute.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
public sealed class CoordOptionsAttribute : Attribute
|
||||
{
|
||||
public readonly Type type0;
|
||||
public readonly Type type1;
|
||||
public readonly Type type2;
|
||||
public readonly Type type3;
|
||||
|
||||
public CoordOptionsAttribute(Type coord)
|
||||
{
|
||||
type0 = coord;
|
||||
}
|
||||
public CoordOptionsAttribute(Type coord, Type coord2)
|
||||
{
|
||||
type0 = coord;
|
||||
type1 = coord2;
|
||||
}
|
||||
public CoordOptionsAttribute(Type coord, Type coord2, Type coord3)
|
||||
{
|
||||
type0 = coord;
|
||||
type1 = coord2;
|
||||
type2 = coord3;
|
||||
}
|
||||
public CoordOptionsAttribute(Type coord, Type coord2, Type coord3, Type coord4)
|
||||
{
|
||||
type0 = coord;
|
||||
type1 = coord2;
|
||||
type2 = coord3;
|
||||
type3 = coord4;
|
||||
}
|
||||
|
||||
public bool Contains<T>() where T : CoordSystem
|
||||
{
|
||||
var type = typeof(T);
|
||||
return (type == type0 || type == type1 || type == type2 || type == type3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user