Esempio n. 1
0
        ////////// CONSTRUCTOR //////////
        public Vehicle(Project project, Node home, Destination dest, VehicleType type, int toDestTime, int toHomeTime)
        {
            _settings = project.Settings;
            ToDestRecord = new List<PointD>();
            ToHomeRecord = new List<PointD>();

            Home = home;
            Destination = dest;
            Type = type;

            if (ToDestTime > ToHomeTime)
                throw new ArgumentException("ToDestinationTime cannot be later than ToHomeTime");

            ToDestTime = toDestTime;
            ToHomeTime = toHomeTime;
            _toDestStarted = false;
            _toHomeStarted = false;
            
            Node end = FindEnd(project);
            _toDestPath = Pathfinder.FindPath(Home, end);
            _toHomePath = Pathfinder.FindPath(end, Home);

            Active = false;
            Speed = 0;
        }
Esempio n. 2
0
 public VehicleData(VehicleType type, List<PointD> toDestRecord, List<PointD> toHomeRecord, int toDestTime, int toHomeTime)
 {
     Type = type;
     ToDestRecord = toDestRecord.ToArray();
     ToHomeRecord = toHomeRecord.ToArray();
     ToDestTime = toDestTime;
     ToHomeTime = toHomeTime;
 }