Package map

Source Code of map.Map

package map;

import java.util.ArrayList;

import logger.Logger;
import route.Route;
import vehicles.OrdinaryCar;
import vehicles.PoliceCar;
import vehicles.RobberyCar;
import vehicles.Vehicle;
import cross.Bank;
import cross.Cross;
import cross.EntryPoint;
import cross.HidingPlace;
import cross.LampCross;
import cross.QuitPoint;
import cross.StopCross;
/**
* A p�lya l�trehoz�s��rt felel�s oszt�ly.
* L�trehozza �s megfelel�en elhelyezi azokat az objektumokat, amelyek egy p�ly�n szerepelni fognak
*
*/
public class Map {

  private ArrayList<Route> routes;
 
  private ArrayList<StopCross> stopcross;
  private ArrayList<LampCross> lampcross;
  private ArrayList<Bank> bank;
  private ArrayList<HidingPlace> hidingplace;
  private ArrayList<EntryPoint> entrypoints = new ArrayList<EntryPoint>();
  private ArrayList<QuitPoint> quitpoints;
 
  private ArrayList<Vehicle> vehicles;
  private ArrayList<PoliceCar> police_cars;
  private ArrayList<OrdinaryCar> ordinary_cars;
  private RobberyCar robberyCar;
 
  /**
   * Map konstruktora:
   * l�trehozza a p�ly�t
   */
  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>();
    stopcross.add(new StopCross());
   
    lampcross = new ArrayList<LampCross>();
    lampcross.add(new LampCross());
   
    bank = new ArrayList<Bank>();
    bank.add(new Bank());
   
    hidingplace = new ArrayList<HidingPlace>();
    hidingplace.add(new HidingPlace());
   
    entrypoints = new ArrayList<EntryPoint>();
    entrypoints.add(new EntryPoint());
   
    quitpoints = new ArrayList<QuitPoint>();
    quitpoints.add(new QuitPoint());
   
 
    //CREATE VEHICLES
    vehicles = new ArrayList<Vehicle>();
   
    police_cars = new ArrayList<PoliceCar>();
    police_cars.add(new PoliceCar());
   
    ordinary_cars = new ArrayList<OrdinaryCar>();
    ordinary_cars.add(new OrdinaryCar());
   
    robberyCar = new RobberyCar()
   
    //ADD VEHICLES TO ROUTES
    Logger.get().addOrdinaryMessage("[Map] Add a police car to a route!");
    routes.get(0).addVehicle(police_cars.get(0));
    Logger.get().addOrdinaryMessage("[Map] Add an ordinary car to a route!");
    routes.get(1).addVehicle(ordinary_cars.get(0));
    Logger.get().addOrdinaryMessage("[Map] Add a robbery car to a route!");
    routes.get(2).addVehicle(robberyCar);
   
    //CONNECT ROUTE AND CROSSES
    connectRouteAndCrosses();
  }
  /**
   * visszaadja az �sszes aut�t
   * @return aut�k
   */
  public Vehicle[] getVehicles() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja az �sszes utat
   * @return utak
   */
  public Route[] getRoutes() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja az �sszes keresztez�d�st
   * @return keresztez�d�sek
   */
  public Cross[] getCrosses() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja az �sszes stop t�bl�s keresztez�d�st
   * @return stop t�bl�s keresztez�d�sek
   */
  public StopCross[] getStopCrosses() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja az �sszes l�mp�s keresztez�d�st
   * @return l�mp�s keresztez�d�sek
   */
  public LampCross[] getLampCrosses() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja a bankot
   * @return bank
   */
  public Bank getBank() {
    throw new UnsupportedOperationException();
  }

  /**
   * Visszaadja a rejtekhelyet
   * @return rejtekhely
   */
  public HidingPlace getHidingPlace() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja a bemen� �ttal rendelkez� v�roshat�rokat
   * @return bel�p�si pontok
   */
  public ArrayList<EntryPoint> getEntryPoints() {
    Logger.get().addMethodCall("", "Map", "getEntryPoints");
    return entrypoints;
  }

  /**a kimen� �ttal rendelkez� v�roshat�rokat
   * @return kil�p� pontok
   */
  public QuitPoint[] getQuitPoints() {
    throw new UnsupportedOperationException();
  }

  /**
   * elind�tja az id�z�t�t a GameTimer oszt�lyban
   */
  public void tickStart() {
    throw new UnsupportedOperationException();
  }

  /**
   * visszaadja a map-et
   * @return map
   */
  public Map getMap() {
    throw new UnsupportedOperationException();
  }

  /**
   * ez a f�ggv�ny felel�s az utak �s a keresztez�d�sek �sszekapcsol�s��rt
   */
  private void connectRouteAndCrosses() {
    Logger.get().addMethodCall("", "Map", "connectRouteAndCrosses");
    routes.get(0).addStartCross(bank.get(0));
    routes.get(0).addEndCross(lampcross.get(0));
   
    routes.get(1).addStartCross(hidingplace.get(0));
    routes.get(1).addEndCross(stopcross.get(0));
   
    routes.get(2).addStartCross(entrypoints.get(0)); //TODO: robbery cart uthoz adjuk, nem bank-hoz...koncepcio: ahhoz az uthoz adjuk, aminek kiindulopontja a bank
    routes.get(2).addEndCross(quitpoints.get(0));
    Logger.get().addMethodReturn("", "Map", "connectRouteAndCrosses");
  }
 
  /**
   * Bemen� �ttal rendelkez� v�roshat�r hozz�ad�sa a maphez
   * @param p Egy referencia a bel�p�si pontr�l
   */
  public void addEntryPoint(EntryPoint p){
    entrypoints.add(p);
  }
}
TOP

Related Classes of map.Map

TOP
Copyright © 2018 www.massapi.com. 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.