Package route

Examples of route.Route


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


  public void vehicleOut() {
    if(vehicleInCross != null){
      ArrayList<Route> al_selectableRoutes = new ArrayList<Route>();
      if(vehicleInCross.getCarType() == carType.Robbery){
        //melyik utrol jott
        Route fromRoute = vehicleInCross.getRoute();
        for(Route r : inroutes){
          if(r != fromRoute)
            al_selectableRoutes.add(r);
        }
        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;     
    }
  }
View Full Code Here

    }
    String pid = params.get(0);
   
    RobberyCar rcar = ObjectStore.getInstance().getRobberyCar();
    int pos = rcar.getPosition();
    Route rroute = rcar.getRoute();
   
    //lekerdezzuk a rendorautot, illetve megvizsgaljuk egyaltalan letezik-e ilyen.
    PoliceCar pcar = ObjectStore.getInstance().getPoliceCar(pid);
    Route proute = pcar.getRoute();
    if(pcar == null){
      return MessageBox.get().getMessage(Messages.NotFound);
    }
    if(rroute == null){
      return MessageBox.get().getMessage(Messages.NotFound) + "(meg nem lepett ra utra(route == null))\r\n";
    }
   
    //ha nem null, akkor hozzaadjuk ugyanahhoz a poziciohoz, ahol a bankrablo is tartozkodik
    rroute.addVehicle(pcar, pos);
    proute.removeCarFromRoute(pcar);
   
    return "A rendorauto("+pcar+") sikeresen hozzaadva az uthoz!\r\n";
  }
View Full Code Here

   */
  public void calcGraphics(){
   
    MainGraphics gr = Game.getInstance().getMap().getGraphics();
   
    Route r = ord.getRoute();
    // ha uton vagyunk es nem keresztezodesben
    if (r!=null){
   
    // az adott ut ket csomopontjanak koordinatainak lekerdezese 
    Cross cr1 = r.getStartCross();
    Point cr1p = gr.getGraphicsFromObject(cr1).getPosition();
    Cross cr2 = r.getEndCross();
    Point cr2p = gr.getGraphicsFromObject(cr2).getPosition();
   
    // konkret pozicio kiszamolasa
    xp = (cr2p.x-cr1p.x)*ord.getPosition()/r.getLength()+cr1p.x;   
    yp = (cr2p.y-cr1p.y)*ord.getPosition()/r.getLength()+cr1p.y;
    System.out.println(xp+","+yp);
   
      //melyik forgat�st hozzuk be: f�gg a k�t csom�pont helyzet�t�l
      setRotateImage(calcRotation(cr1p,cr2p));
    }
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

  public Point getLampPosition(int n){
    // MainGraphics-hoz hozzaferes
    MainGraphics gr = Game.getInstance().getMap().getGraphics();
   
    // lampa helye megnezzuk az elso bemeno utat:
    Route r = cr.getInRoutes().get(n);
   
    //megnezzuk a ket csomopontjat
    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 lampat
    Point pos = new Point(cr2p.x+(cr1p.x-cr2p.x)/6+10,cr2p.y+(cr1p.y-cr2p.y)/6);
   
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

  public Utkozeselkerules(){
    clearScreen();
    Logger.get().addOrdinaryMessage("___________KET AUTO AZ UTON, UTKOZESELKERULES___________");
    GameTimer.setNotifyEnabled(false);//turn off time.
    Logger.get().addOrdinaryMessage("[[[Kiindulohelyzet kialakitasa]]]");
    route = new Route();
    vehicle1 = new OrdinaryCar();
    vehicle2 = new OrdinaryCar();
    route.addVehicle(vehicle1);
    route.addVehicle(vehicle2);
    Logger.get().addOrdinaryMessage("[[[Kiindulohelyzet kialakitasa vege]]]");
View Full Code Here

    Logger.get().addOrdinaryMessage("___________JARMU EL�RI A REJTEKHELYET___________");
    GameTimer.setNotifyEnabled(false);//turn off time.
    Logger.get().addOrdinaryMessage("[[[Kiindulohelyzet kialakitasa]]]");
    Logger.get().addOrdinaryMessage("[Bemeno utak letrehozasa a rejtekhelyhez]");
   
    Route inRoute = new Route();
   
    Logger.get().addOrdinaryMessage("[A bankrablok autoja erjen a rejtekhelyre?(i/n)]");
    boolean isRobberyCar = false;
    boolean goForward = false;
   
    String input = in.readLine()
   
    while(!goForward){
     
   
    if(input.equals("i")){
      isRobberyCar = true;
      goForward = true;
    } else if(input.equals("n")){
      isRobberyCar = false;
      goForward = true;
    } else {
      System.out.println("Ez nem opcio...");
    }
    }
   
    Vehicle vehicle;
   
    if (isRobberyCar)
    {
      vehicle = new RobberyCar();
      inRoute.addVehicle(vehicle);
     
    }
    else
    {
      vehicle = new OrdinaryCar();
      inRoute.addVehicle(vehicle)
    }
     
    Logger.get().addOrdinaryMessage("[Bemeno utak hozzaadasa...]");
    hidingPlace.addInRoutes(inRoute);
    Logger.get().addOrdinaryMessage("[Kimeno utak hozzaadasa...]");
    hidingPlace.addOutRoutes(new Route());
   
    Logger.get().addOrdinaryMessage("[Bemeno utak hozzaadasa...]");
   
    Logger.get().addOrdinaryMessage("[Bemeno utak hozzaadasa...]");
    hidingPlace.addInRoutes(inRoute);
    Logger.get().addOrdinaryMessage("[Kimeno utak hozzaadasa...]");
    hidingPlace.addOutRoutes(new Route());
   
   
    Logger.get().addOrdinaryMessage("[[[Kiindulohelyzet kialakitasa VEGE]]]");
    Logger.get().addOrdinaryMessage("[HidingPlace.updateVehicleAtCross meghivasa...]");
    hidingPlace.updateVehiclesAtCross();
View Full Code Here

    try{
      clearScreen();
     
      Logger.get().addOrdinaryMessage("___________Ido leptetese szekvencia!___________");
      GameTimer.setNotifyEnabled(true);
      route = new Route();
      entry_point = new EntryPoint();
      quit_point = new QuitPoint();
      stop_cross = new StopCross();
      lamp_cross = new LampCross();
      bank = new Bank();
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.