Package ch.fusun.baron.player.api

Examples of ch.fusun.baron.player.api.Country


  }

  @Override
  public Country createCountry(String name) {
    synchronized (countries) {
      Country country = new Country(counter++, name);
      countries.put(name, country);
      updateAllListeners(new CreateCountryDataUpdate(name));
      return country;
    }
  }
View Full Code Here


  @SuppressWarnings("rawtypes")
  @Override
  public Collection<TileChild> getChildren(Tile tile) {
    City city = cityService.getCity(tile);
    Collection<TileChild> children = new ArrayList<TileChild>();
    Country country = (Country) propertyService.getOwnership(tile);
    Dynasty dynasty = playerService.getDynasty((Player) propertyService
        .getOwnership(country));
    if (city != null) {
      children.add(new CityDynastyTileChild(dynasty));
    }
View Full Code Here

   */
  @Test
  public void testSimpleDead() {
    Player person = new Player(0, "Albert", Gender.MALE);
    person.kill();
    Country country = new Country(0, "Country");
    propertyService.setOwnership(person, country);
    reinject();
    turntask.execute();
    Object owner = propertyService.getOwnership(country);
    assertNull("The country should not be owned; Current owner: " + owner,
View Full Code Here

  private PropertyService propertyService;

  @Override
  public void execute() {
    for (City city : cityService.getCities()) {
      Country country = (Country) propertyService
          .getOwnership(cityService.getLocation(city));
      Player owner = (Player) propertyService.getOwnership(country);
      treasuryService.addMoney(playerService.getDynasty(owner),
          MONEY_PER_CITY * city.getPopulation());
    }
 
View Full Code Here

  public void testSimpleFamily() {
    Player male = new Player(0, "Albert", Gender.MALE);
    Player female = new Player(1, "Alberta", Gender.FEMALE);
    marriageService.marry(male, female);
    male.kill();
    Country country = new Country(0, "Country");
    propertyService.setOwnership(male, country);
    reinject();
    turntask.execute();
    Object owner = propertyService.getOwnership(country);
    assertNotNull("The country should be owned; Current owner: " + owner,
View Full Code Here

    Player female = new Player(1, "Alberta", Gender.FEMALE);
    marriageService.marry(male, female);
    Player son = new Player(2, "Albertino", Gender.MALE);
    giveBirth(male, female, son);
    male.kill();
    Country country = new Country(0, "Country");
    propertyService.setOwnership(male, country);
    reinject();
    turntask.execute();
    Object owner = propertyService.getOwnership(country);
    assertNotNull("The country should be owned; Current owner: " + owner,
View Full Code Here

    marriageService.marry(male, female);
    Player son = new Player(2, "Albertino", Gender.MALE);
    giveBirth(male, female, son);
    male.kill();
    female.kill();
    Country country = new Country(0, "Country");
    propertyService.setOwnership(female, country);
    reinject();
    turntask.execute();
    Object owner = propertyService.getOwnership(country);
    assertNotNull("The country should be owned; Current owner: " + owner,
View Full Code Here

   * Tests the scenario without children and without spouse
   */
  @Test
  public void testSimple() {
    Player person = new Player(0, "Albert", Gender.MALE);
    Country country = new Country(0, "Country");
    propertyService.setOwnership(person, country);
    reinject();
    turntask.execute();
    assertNotNull("The country should be owned",
        propertyService.getOwnership(country));
View Full Code Here

  private void createDynastyForUser(User user) {
    Dynasty dynasty = new Dynasty(
        userDynastyMap.get(user) == null ? user.getName()
            : userDynastyMap.get(user), userCOADynastyMap.get(user));
    Country country = countryService
        .createCountry(userDynastyMap.get(user));
    Player man = playerService.generateNewPlayer(Gender.MALE);
    man.setAge(INITIAL_AGE_MAN);
    Player woman = playerService.generateNewPlayer(Gender.FEMALE);
    woman.setAge(INITIAL_AGE_WOMAN);
View Full Code Here

TOP

Related Classes of ch.fusun.baron.player.api.Country

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.