using System.Collections.Generic; using WSMGameStudio.Splines; using UnityEngine; namespace WSMGameStudio.RailroadSystem { [System.Serializable] public class Route { [SerializeField] private string _name; [SerializeField] private List _splines; [System.NonSerialized] private OrientedPoint[][] _normalizedRoute; //Calculate on loading time by the route manager public string Name { get { return _name; } set { _name = value; } } public List Splines { get { return _splines; } set { _splines = value; } } public OrientedPoint[][] NormalizedRoute { get { return _normalizedRoute; } set { _normalizedRoute = value; } } /// /// True if route has splines assigned to it /// public bool IsValid { get { return (_splines != null && _splines.Count > 0); } } public int Length { get { int length = _splines == null ? 0 : _splines.Count; return length; } } /// /// Constructor /// /// public Route(string name) { _name = name; _splines = new List(); } } }