Package route

Examples of route.Route


  public Map(){
    Logger.get().addOrdinaryMessage("[Map.Constructor]: Called!");
    //CREATE ROUTES
    routes = new ArrayList<Route>();
    for(int i = 0; i < 3; i++){
      routes.add(new Route());
    }
   
    //CREATE CROSSES
    //create stop crosses
    stopcross = new ArrayList<StopCross>();
View Full Code Here


   *
   * az entrypointban l�v� aut�t kil�pteti
   */
  @Override
  public void vehicleOut() {
    Route selectedOutRoute = vehicleInCross.selectRoute(outroutes);
    selectedOutRoute.addVehicle(vehicleInCross);
    vehicleInCross = null;
  }
View Full Code Here

    // BANK
    bank = new Bank();
   

    // ROUTES
    Route r0 = new Route(this, bank, quitpoints.get(0), 2000 * 4);
    Route r1 = new Route(this, entrypoints.get(0), bank, 1600 * 4);
    Route r2 = new Route(this, entrypoints.get(0), stopcross.get(0),
        1800 * 4);
    Route r3 = new Route(this, bank, lampcross.get(0), 1800 * 4);
    Route r4 = new Route(this, bank, hidingplace, 1600 * 4);
    Route r5 = new Route(this, stopcross.get(0), hidingplace, 1900 * 4);
    Route r6 = new Route(this, hidingplace, lampcross.get(0), 1800 * 4);
    Route r7 = new Route(this, lampcross.get(0), stopcross.get(0), 1200 * 4);
    Route r8 = new Route(this, stopcross.get(0), bank, 2000 * 4);
    routes.add(r0);
    routes.add(r1);
    routes.add(r2);
    routes.add(r3);
    routes.add(r4);
 
View Full Code Here

   * Feluldefinialjuk az ososztaly metodusat, mivel minden mas tipusu keresztezodesnek, mas szabalyai vannak
   */
  @Override
  public void updateVehiclesAtCross() {
    try{
      Route primaryRoute = inroutes.get(0);
      Route secondaryRoute = inroutes.get(1);
     
      //egy gyors vizsgalat az utkozesre
      if(primaryRoute.getLastCar() != null && secondaryRoute.getLastCar() != null && secondaryRoute.getLastCar().getCarType() == carType.Robbery){
        Game.getInstance().finishGame();
      }
     
     
      //bepakoljuk a keresztezodesnel varakozo
      if(primaryRoute.getLastCar() != null){
        stepIntoCross(primaryRoute);
      }
      if(primaryRoute.getLastCar() == null && secondaryRoute.getLastCar() != null && vehicleInCross == null){
        //beleptetjuk a masodlagos utrol, ha az elsodlegesen nem voltak es ures a keresztezodes
        stepIntoCross(secondaryRoute);
      }
    } catch(Exception e){
      e.printStackTrace();
View Full Code Here

   
    //BANK
    bank = new Bank();
   
    //ROUTES
    Route r0 = new Route(this, entrypoints.get(0),hidingplace, 1000);
    Route r1 = new Route(this, stopcross.get(0), hidingplace, 800);
    Route r2 = new Route(this, entrypoints.get(0), stopcross.get(0), 900);
    Route r3 = new Route(this, hidingplace, lampcross.get(0), 900);
    Route r4 = new Route(this, stopcross.get(0),lampcross.get(0), 800)
    Route r5 = new Route(this, entrypoints.get(0), lampcross.get(0), 600);
    Route r6 = new Route(this, lampcross.get(0), bank, 1000);
    Route r7 = new Route(this, bank,quitpoints.get(0), 1000);
    Route r8 = new Route(this, entrypoints.get(0),bank, 1000);
   
    routes.add(r0);
    routes.add(r1);
    routes.add(r2);
    routes.add(r3);
View Full Code Here

          for(Route r : outroutes){
            //if(r != fromRoute)
              al_selectableRoutes.add(r);
          }
         
          Route selectedOutRoute = vehicleInCross.selectRoute(al_selectableRoutes);
          selectedOutRoute.addVehicle(vehicleInCross);
        } else {
          Route selectedOutRoute = vehicleInCross.selectRoute(outroutes);
          selectedOutRoute.addVehicle(vehicleInCross)
        }
        vehicleInCross = null;     
      }
    } catch(Exception e){
      e.printStackTrace();
View Full Code Here

      if(speed < 0 || speed > 100){
        return MessageBox.get().getMessage(Messages.WrongParameter) + ("(Sebesseg: 0-100)\r\n");
      }
     
      //lekerjuk a szukseges objektumokat
      Route destRoute = ObjectStore.getInstance().getRoute(routeId);
      PoliceCar pcar = ObjectStore.getInstance().getPoliceCar(policeId);
      if(destRoute == null || pcar ==null){
        return MessageBox.get().getMessage(Messages.NotFound);
      }
     
      //beallitjuk az uj poziciora a rendorautot
      Route proute = pcar.getRoute();
      proute.removeCarFromRoute(pcar);
      destRoute.addVehicle(pcar, routePos);
      pcar.setSpeed(speed);
     
      return "Sikeresen beallitott rendorauto adatok!\r\n";
    } catch (NumberFormatException e){
View Full Code Here

    //get the id
    String routeId = params.get(0);

    //get the rotute
    Route route = ObjectStore.getInstance().getRoute(routeId);
    if(route == null){
      return MessageBox.get().getMessage(Messages.NotFound);
    }
   
    //get the vehicles
    ArrayList<Vehicle> vehicles = route.getVehiclesFromRoute();
    if(vehicles.size() == 0){
      return MessageBox.get().getMessage(Messages.EmptyRoute);
    }
   
   
View Full Code Here

  {
    // MainGraphics-hoz hozzaferes
    MainGraphics gr = Game.getInstance().getMap().getGraphics();
   
    // stoptabla helye megnezzuk az elso bemeno utat:
    Route r = cr.getInRoutes().get(1);
   
    //megnezzuk a ket csomopontjat a kijelolt utnak
    Cross cr1 = r.getStartCross();
    Point cr1p = gr.getGraphicsFromObject(cr1).getPosition();
    Cross cr2 = r.getEndCross();
    Point cr2p = gr.getGraphicsFromObject(cr2).getPosition();
   
    // a tavolsag tizedenel helyezzuk el a tablat
    Point pos = new Point(cr2p.x+(cr1p.x-cr2p.x)/10,cr2p.y+(cr1p.y-cr2p.y)/10);
   
View Full Code Here

      if(speed < 0 || speed > 50){
        return MessageBox.get().getMessage(Messages.WrongParameter) + ("(Sebesseg: 0-50)\r\n");
      }
     
      //lekerjuk a szukseges objektumokat
      Route destRoute = ObjectStore.getInstance().getRoute(routeId);
      OrdinaryCar ocar = ObjectStore.getInstance().getOrdinaryCar(ordinaryId);
      if(destRoute == null || ocar == null){
        return MessageBox.get().getMessage(Messages.NotFound);
      }
     
      //beallitjuk az uj poziciora a rendorautot
      Route proute = ocar.getRoute();
      proute.removeCarFromRoute(ocar);
      destRoute.addVehicle(ocar, routePos);
      ocar.setSpeed(speed);
     
      return "Sikeresen beallitott altalanos auto adatok!\r\n";
    } catch (NumberFormatException e){
View Full Code Here

TOP

Related Classes of route.Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.