예제 #1
0
파일: MapService.java 프로젝트: pancky/Risk
  private void createSouthAmericaCountries(Continent continent, GameMatch gameMatch) {
    List<Country> countrys = new ArrayList<Country>();

    Country venezuela = new Country("Venezuela", continent);
    Country peru = new Country("Peru", continent);
    Country brazil = new Country("Brazil", continent);
    Country argentinia = new Country("Argentinia", continent);

    venezuela.setBorderCountryList(Arrays.asList(peru, brazil));
    peru.setBorderCountryList(Arrays.asList(venezuela, brazil, argentinia));
    brazil.setBorderCountryList(Arrays.asList(venezuela, peru, argentinia));
    argentinia.setBorderCountryList(Arrays.asList(peru, brazil));

    venezuela.setGamematch(gameMatch);
    peru.setGamematch(gameMatch);
    brazil.setGamematch(gameMatch);
    argentinia.setGamematch(gameMatch);

    // add the shape and origin
    venezuela.setShape("175,325 165,340 162,375 200,385 225,350 275,350 232,320 210,310 175,325");
    venezuela.setOriginx("196");
    venezuela.setOriginy("347");

    peru.setShape("162,375 200,385 250,412 260,460 225,450 210,435 175,400 162,375");
    peru.setOriginx("206");
    peru.setOriginy("417");

    brazil.setShape(
        "200,385 225,350 275,350 325,375 330,400 320,425 300,450 280,455 275,475 260,460 250,412 200,385");
    brazil.setOriginx("269");
    brazil.setOriginy("391");

    argentinia.setShape(
        "260,460 225,450 210,435 200,475 200,550 225,575 250,585 235,550 250,500 275,475 260,460");
    argentinia.setOriginx("218");
    argentinia.setOriginy("486");

    countrys.add(venezuela);
    countrys.add(peru);
    countrys.add(brazil);
    countrys.add(argentinia);
    countryRepository.save(countrys);
  }
예제 #2
0
파일: MapService.java 프로젝트: pancky/Risk
  private void createAfricaCountries(Continent continent, GameMatch gameMatch) {
    List<Country> countrys = new ArrayList<Country>();

    Country northafrica = new Country("North Africa", continent);
    Country egypt = new Country("Egypt", continent);
    Country eastafrica = new Country("East Africa", continent);
    Country congo = new Country("Congo", continent);
    Country southafrica = new Country("South Africa", continent);
    Country madagaskar = new Country("Madagaskar", continent);

    northafrica.setBorderCountryList(Arrays.asList(egypt, eastafrica, congo));
    egypt.setBorderCountryList(Arrays.asList(northafrica, eastafrica));
    eastafrica.setBorderCountryList(Arrays.asList(egypt, northafrica, congo, madagaskar));
    congo.setBorderCountryList(Arrays.asList(northafrica, eastafrica, southafrica));
    southafrica.setBorderCountryList(Arrays.asList(congo, eastafrica, madagaskar));
    madagaskar.setBorderCountryList(Arrays.asList(southafrica, eastafrica));

    // add the shape and origin
    northafrica.setShape(
        "375,317 425,312 450,325 450,375 490,380 490,425 475,450 437,450 435,430 400,425 360,400 355,355 375,317");
    northafrica.setOriginx("394");
    northafrica.setOriginy("373");

    egypt.setShape(
        "450,325 450,375 490,380 525,375 510,345 520,335 510,325 500,335 475,320 450,325");
    egypt.setOriginx("489");
    egypt.setOriginy("342");

    eastafrica.setShape(
        "525,375 490,380 490,425 525,450 525,485 535,500 535,465 575,410 545,415 525,375");
    eastafrica.setOriginx("515");
    eastafrica.setOriginy("414");

    congo.setShape("525,450 490,425 475,450 437,450 450,475 500,500 525,450");
    congo.setOriginx("495");
    congo.setOriginy("471");

    southafrica.setShape(
        "535,500 525,485 525,450 500,500 450,475 437,450 450,500 475,575 500,585 525,525 535,500");
    southafrica.setOriginx("488");
    southafrica.setOriginy("529");

    madagaskar.setShape("550,550 560,510 585,485 585,525 565,565 550,550");
    madagaskar.setOriginx("569");
    madagaskar.setOriginy("527");

    northafrica.setGamematch(gameMatch);
    egypt.setGamematch(gameMatch);
    eastafrica.setGamematch(gameMatch);
    congo.setGamematch(gameMatch);
    southafrica.setGamematch(gameMatch);
    madagaskar.setGamematch(gameMatch);

    countrys.add(northafrica);
    countrys.add(egypt);
    countrys.add(eastafrica);
    countrys.add(congo);
    countrys.add(southafrica);
    countrys.add(madagaskar);
    countryRepository.save(countrys);
  }