2019-04-06 21:13:55 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-04-07 02:34:12 +02:00
|
|
|
|
using GL_EditorFramework.EditorDrawables;
|
|
|
|
|
using OpenTK;
|
2019-04-06 21:13:55 +02:00
|
|
|
|
|
|
|
|
|
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
|
|
|
|
{
|
2019-04-08 03:14:39 +02:00
|
|
|
|
public class LapPathGroup : BasePathGroup, IObject
|
2019-04-06 21:13:55 +02:00
|
|
|
|
{
|
|
|
|
|
public const string N_LapPathGroup = "LapPathGroup";
|
|
|
|
|
public const string N_ReturnPointsError = "ReturnPointsError";
|
|
|
|
|
public const string N_UnitIdNum = "UnitIdNum";
|
|
|
|
|
|
|
|
|
|
public List<ReturnPoint> ReturnPoints = new List<ReturnPoint>();
|
|
|
|
|
|
|
|
|
|
public LapPathGroup(dynamic bymlNode)
|
|
|
|
|
{
|
|
|
|
|
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
|
|
|
|
|
else throw new Exception("Not a dictionary");
|
|
|
|
|
|
|
|
|
|
foreach (var point in this["PathPt"])
|
|
|
|
|
{
|
|
|
|
|
PathPoints.Add(new LapPathPoint(point));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var point in this["ReturnPoints"])
|
|
|
|
|
{
|
|
|
|
|
ReturnPoints.Add(new ReturnPoint(point));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
public Dictionary<string, dynamic> Prop { get; set; } = new Dictionary<string, dynamic>();
|
|
|
|
|
|
|
|
|
|
public int LapPathGroupId
|
|
|
|
|
{
|
|
|
|
|
get { return this[N_LapPathGroup]; }
|
|
|
|
|
set { this[N_LapPathGroup] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int ReturnPointsError
|
|
|
|
|
{
|
|
|
|
|
get { return this[N_ReturnPointsError]; }
|
|
|
|
|
set { this[N_ReturnPointsError] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int UnitIdNum
|
|
|
|
|
{
|
|
|
|
|
get { return this[N_UnitIdNum]; }
|
|
|
|
|
set { this[N_UnitIdNum] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public dynamic this[string name]
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Prop.ContainsKey(name)) return Prop[name];
|
|
|
|
|
else return null;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (Prop.ContainsKey(name)) Prop[name] = value;
|
|
|
|
|
else Prop.Add(name, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-08 03:14:39 +02:00
|
|
|
|
public class LapPathPoint : BasePathPoint
|
2019-04-06 21:13:55 +02:00
|
|
|
|
{
|
2019-04-07 03:45:25 +02:00
|
|
|
|
private RenderablePathPoint renderablePoint;
|
|
|
|
|
|
2019-04-07 02:34:12 +02:00
|
|
|
|
[Browsable(false)]
|
|
|
|
|
public override RenderablePathPoint RenderablePoint
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2019-04-07 03:45:25 +02:00
|
|
|
|
if (renderablePoint == null)
|
|
|
|
|
renderablePoint = new RenderablePathPoint(new Vector4(0f, 0.25f, 1f, 0.1f), Translate, Rotate, Scale, this);
|
|
|
|
|
return renderablePoint;
|
2019-04-07 02:34:12 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-06 21:13:55 +02:00
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public int CheckPoint
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["CheckPoint"] != null ? this["CheckPoint"] : -255; }
|
|
|
|
|
set { if (value != -255) this["CheckPoint"] = value; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public int ClipIdx
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["ClipIdx"] != null ? this["ClipIdx"] : -255; }
|
|
|
|
|
set { if (value != -255) this["ClipIdx"] = value; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public bool HeadLightSW
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["HeadLightSW"] != null ? this["HeadLightSW"] : false; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
set { this["HeadLightSW"] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public int LapCheck
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["LapCheck"] != null ? this["LapCheck"] : -255; }
|
|
|
|
|
set { if (value != -255) this["LapCheck"] = value; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public int MapCameraFovy
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["MapCameraFovy"] != null ? this["MapCameraFovy"] : -255; }
|
|
|
|
|
set { if (value != -255) this["MapCameraFovy"] = value; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Category("Properties")]
|
|
|
|
|
public int MapCameraY
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return this["MapCameraY"] != null ? this["MapCameraY"] : -255; }
|
|
|
|
|
set { if (value != -255) this["MapCameraY"] = value; }
|
2019-04-06 21:13:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LapPathPoint(dynamic bymlNode)
|
|
|
|
|
{
|
|
|
|
|
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
|
|
|
|
|
else throw new Exception("Not a dictionary");
|
|
|
|
|
|
|
|
|
|
foreach (var point in this["NextPt"])
|
|
|
|
|
{
|
|
|
|
|
NextPoints.Add(new PointID(point));
|
|
|
|
|
}
|
|
|
|
|
foreach (var point in this["PrevPt"])
|
|
|
|
|
{
|
|
|
|
|
PrevPoints.Add(new PointID(point));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|