Package civquest.core

Examples of civquest.core.Game


      for (int y = 0; y < visibilityLevels[0].length; y++) {
        visibilityLevels[x][y] = INVISIBLE;
      }     
    }

    Game game = Game.getGame();
    MapObjectReader moReader = game.getMapObjectReader();
    CityReader cityReader = game.getCityReader();
    NationReader nationReader = game.getNationReader();

    Iterator<Long> unitIterator = nationReader.getAllUnits(nation.getID());
    while (unitIterator.hasNext()) {
      Long currUnitID = unitIterator.next();
      Coordinate currUnitPosition = moReader.getMapObjectPosition(currUnitID);
View Full Code Here


  }

  public void actionPerformed(FunctionActionEvent e) {
    try {
      Game.constructGame(registry);
      Game game = Game.getGame();
      game.loadUnitRulesets();

      constructMap();
      addSomePlayersAndNations();

      GUIBuilder.buildGameGUI(civQuest);
View Full Code Here

  }

  // Just for adding a sample map as long as this can't be done in a proper way
  private void constructMap() throws ConfigurationException {
    Game game = Game.getGame();
    MapGenerator mg = new MapGenerator(game.getRegistry());
    mg.generate();   
  }
View Full Code Here

    addACity(nation2);

        Player player1 = new Player("John Doe");
        Player player2 = new Player("Jack Doe");
   
    Game game = Game.getGame();
        game.add(player1);
        game.add(player2);
        game.assignPlayerToNation(player1, nation1);
        game.assignPlayerToNation(player2, nation2);

//         // This activates the first nation, otherwise no nation would be active
//     // at the very beginning
//         game.nextNation();   
  }
View Full Code Here

  }

  public void execute() {
    notifyBefore();

    Game game = Game.getGame();
        Messages messages = Messages.getMessages();
        MapData mapData = Game.getMapData();
        Field field = mapData.getField(location);
        Nation nation = game.getNation(owner);

        Iterator<Unit> unitsIt = field.getUnitIterator();
        if (unitsIt.hasNext()) {
            Unit unit = unitsIt.next();
            if (!unit.getOwner().equals(nation)) {
View Full Code Here

      name = loadedData.getString("name");
    } else if (step == LoadingStep.REFERENCE) {

      // set up Map with nations controlled by this player, set reference
      // Nation --> Player controlling the nation.
      Game game = Game.getGame();
      nations = new HashMap<Long, Nation>();
       Set<Long> nationIDs = loadedData.getLongHashSet("nations");
      for (Long currID : nationIDs) {
        Nation currNation = game.getNation(currID);
        nations.put(currID, currNation);
        currNation.setPlayer(this);
      }
    }
  } 
View Full Code Here

  public void paintComponent(Graphics g) {
    int x = 0;
    int y = 15;
   
    Game game = Game.getGame();
    int turn = game.getTurn();
    Nation activeNation = game.getActiveNation();
    Nation currNation = (gameData == null ? null : gameData.getNation());

    Text text = new Text(g, 5, 15);
    text.write("Turn: " + turn + INFORMATION_SEPARATOR);
View Full Code Here

  public void actionPerformed(FunctionActionEvent e) {
    try {
      Registry registry = civQuest.getTopRegistry();
      Game.constructGame(registry);
      Game game = Game.getGame();
      game.loadUnitRulesets();

      constructMap();
      game.initialize();

      GUIBuilder.buildScenarioEditorGUI(civQuest);
    } catch (RulesetException ex) {
      CivQuest.showErrorQuitDialog("There is a problem related to ruleset-loading:", ex);
    } catch (GameChangeException ex) {
View Full Code Here

        setWaterFlowTo(waterFlowToCoord);
      }

      population = loadedData.getLong("population", 0l);

      Game game = Game.getGame();
      for (MapObject mo : mapObjects) {
        game.add(mo);
      }

      Long rulingCityID = loadedData.getLong("rulingCity");
      if (rulingCityID != null) {
        rulingCity = Game.getGame().getCity(rulingCityID);
View Full Code Here

    }

  }

  private void constructMap() throws ConfigurationException {
    Game game = Game.getGame();
    MapGenerator mg = new MapGenerator(game.getRegistry());
    mg.generateEmptyMap();       
  }
View Full Code Here

TOP

Related Classes of civquest.core.Game

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.