Exemplo 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;
        }
 public GUIToolEditDestination(Destination dest, Project project)
 {
     Destination = dest;
     Project = project;
     Setup();
     Load += ReadData;
     FormClosing += SaveData;
 }