Package vehicles

Examples of vehicles.RobberyCar


    entrypoints.get(0).addOutRoutes(routes.get(8));
    bank.addInRoutes(routes.get(8));
   
   
    //AUTOK LETREHOZASA
    robberyCar = new RobberyCar(bank, 100);
   
    PoliceCar pc1 = new PoliceCar(70);
    police_cars.add(pc1);
   
    OrdinaryCar ordc1 = new OrdinaryCar(40);
View Full Code Here


   *
   * A k�rd�sn�l csak "i" vagy "n" bemenetet fogad el, m�s bemenet eset�n �jb�l k�rdez.
   */
  public void collisionDetect() {
    //megvizsgaljuk, hogy elutotte-e a nyulat a rablo
    RobberyCar rcar = m.getRobberyCar();
    if(bunny != null && rcar.getRoute() == this){
      if(rcar.getTurned()){
        if((rcar.getPosition() <= bunny.getPos()) && (rcar.getPosition() + rcar.getCurrentSpeed() >= Bunny.get().getPos())){
          rcar.setImmune(true);
          rcar.setImmuneTime(Bunny.get().getImmuneTime());
        }
      } else {
        if((rcar.getPosition() >= bunny.getPos()) && (rcar.getPosition() + rcar.getCurrentSpeed() <= bunny.getPos())){
          rcar.setImmune(true);
          rcar.setImmuneTime(bunny.getImmuneTime());
          bunny.setHit();
        }
      }
    }
   
View Full Code Here

      //bepakoljuk az ut vegere
      v.setPosition(length);
      //probaljon meg olyan sebesseggel haladni "amilyennel szerene"
      v.setCurrentSpeed(v.getSpeed());
     
      RobberyCar rcar = (RobberyCar)v;
      if(rcar.getTurned()){
        rcar.turn();
      } else {
        //hax... igy tuti jok lesznek a sebesseg elojelek, meg ilyesmik
        rcar.turn();
        rcar.turn();
      }
    } else {
      vehicles.add(v);
      //ezen az uton halad
      v.setRoute(this);
View Full Code Here

    if(params.size() != 1){
      return MessageBox.get().getMessage(Messages.CommandNotFound);
    }
    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){
View Full Code Here

   *
   * A k�rd�sn�l csak "i" vagy "n" bemenetet fogad el, m�s bemenet eset�n �jb�l k�rdez.
   */
  public void collisionDetect() {
    //megvizsgaljuk, hogy elutotte-e a nyulat a rablo
    RobberyCar rcar = m.getRobberyCar();
    if(bunny != null && rcar.getRoute() == this){
      if(rcar.getTurned()){
        if((rcar.getPosition() <= bunny.getPos()) && (rcar.getPosition() + rcar.getCurrentSpeed() >= Bunny.get().getPos())){
          rcar.setImmune(true);
          rcar.setImmuneTime(Bunny.get().getImmuneTime());
          bunny.setHit();
        }
      } else {
        if((rcar.getPosition() >= bunny.getPos()) && (rcar.getPosition() + rcar.getCurrentSpeed() <= bunny.getPos())){
          rcar.setImmune(true);
          rcar.setImmuneTime(bunny.getImmuneTime());
          bunny.setHit();
        }
      }
    }
   
View Full Code Here

      return MessageBox.get().getMessage(Messages.ParameterCountMismatch) + "\r\n";
    }
   
    Integer selectedRoute = Integer.parseInt(params.get(0));
   
    RobberyCar rcar = ObjectStore.getInstance().getRobberyCar();
    Cross rcross = rcar.getCross();

    //hozzunk letre egy kozos listat
    ArrayList<Route> al_routes = new ArrayList<Route>();
   
    //bejovo
    List<Route> inR = rcross.getInRoutes();
    al_routes.addAll(inR);
   
    //kimeno
    List<Route> outR = rcross.getOutRoutes();
    al_routes.addAll(outR);
   
    //ha olyan szamot kaptunk ami nagyobb a tombtol
    if(selectedRoute > al_routes.size() || selectedRoute < 0){
      return MessageBox.get().getMessage(Messages.WrongParameter) + "\r\n";
    }
   
    Integer i = 1;
    for(Route r : al_routes){
      if(r != rcar.getRoute()){
        System.out.print((i)+" ");
      } else {
        if(i == selectedRoute){
          return MessageBox.get().getMessage(Messages.WrongParameter)+ "\r\n";
        }
View Full Code Here

   */
  public void collisionDetect() {
    try {
      boolean goForward = false; //for testing...
      boolean isCollisionDetected = true;//
      RobberyCar rcar;//storing the robbery car...
      Logger.get().addMethodCall("", "Route", "collisionDetect");
      //getting the robbery car's position
      Logger.get().addOrdinaryMessage("[Route.collisionDetect()] Lekerjuk a rablo poziciojat...");
      for(Vehicle v : vehicles){
        if(v.getCarType() == carType.Robbery){
          rcar = (RobberyCar) v;
          rcar.getPosition();
        }
      }
      Logger.get().addOrdinaryMessage("[Route.collisionDetect()] Egy iteracioban lekerjuk az uton levo osszes tobbi kocsi poziciojat...");
      Logger.get().addOrdinaryMessage("Szeretned, h legyen utkozes?(i/n)");
     
View Full Code Here

    if(params.size() != 0){
      return MessageBox.get().getMessage(Messages.ParameterCountMismatch);
    }
    StringBuilder resultString = new StringBuilder();
   
    RobberyCar rcar = ObjectStore.getInstance().getRobberyCar();
   
    //terjunk vissza errorral, hogyha nem talaljuk az autot
    if(rcar == null){
      return MessageBox.get().getMessage(Messages.NotFound);
    }
   
    //osszepakoljuk az eredmenyt
    String routeId = ObjectStore.getInstance().getRouteKey(rcar.getRoute());
    String crossId = ObjectStore.getInstance().getCrossKey(rcar.getCross());
    resultString.append("____RobberyCar____\n");
    resultString.append("Aktualis sebesseg: " + rcar.getCurrentSpeed() + "\r\n");
    resultString.append("Eredeti sebesseg: " + rcar.getSpeed() + "\r\n");
    resultString.append("Pozicioja az uton: " + rcar.getPosition() + "\r\n");
    resultString.append("Az ut id-je amin van: " + routeId + "\r\n");
    resultString.append("Az keresztezodes id-je ami fele halad: " + crossId + "\r\n");
    resultString.append("Iranya az adott uton: " + (rcar.getTurned() ? "forgalommal megegyezo irany\r\n" : "forgalommal szemben halad\r\n"));
    resultString.append("A kovetkezo kimenetnel, a kovetkezo indexu utat valasztja: " + rcar.getDesiredDirection() + "\r\n");
    resultString.append("Immunis-e: " + (rcar.getImmune() ? "igen\r\n" : "nem\r\n"));
   
    return resultString.toString();
  }
View Full Code Here

   
    Vehicle vehicle;
   
    if (isRobberyCar)
    {
      vehicle = new RobberyCar();
      inRoute.addVehicle(vehicle);
     
    }
    else
    {
View Full Code Here

     
      Vehicle vehicle;
     
      if (isRobberyCar)
      {
        vehicle = new RobberyCar();
        inRoute.addVehicle(vehicle);
       
      }
      else
      {
View Full Code Here

TOP

Related Classes of vehicles.RobberyCar

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.