Android Open Source - AndroidSettlers Automated Player






From Project

Back to project page AndroidSettlers.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidSettlers listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.settlers.hd;
/*w  ww .ja v a  2  s . co  m*/
public interface AutomatedPlayer {

  /**
   * Select the location to build a town; Note: you must build there before
   * returning
   * 
   * @param vertices
   *            the vertex list
   * @return the index of the vertex you built on
   */
  public int setupTown(Vertex[] vertices);

  /**
   * Select the location to place a road; Note: you must build there before
   * returning
   * 
   * @param edges
   *            the edge list
   * @return the index of the edge you built on
   */
  public int setupRoad(Edge[] edges);

  /**
   * Select the location to place a road; Note: you must build there before
   * returning
   * 
   * @note in the case where a road can't be built, return -1
   * 
   * @param edges
   *            the edge list
   * @return the index of the edge you built on or -1
   */
  public int progressRoad(Edge[] edges);

  /**
   * Run production phase
   */
  public void productionPhase();

  /**
   * Run build phase
   */
  public void buildPhase();

  /**
   * Select a hexagon to place the robber
   * 
   * @param hexagons
   *            the list of hexagons
   * @param exception
   *            forbidden location (where the robber came from)
   * @return the index of the hexagon to place the robber on
   */
  public int placeRobber(Hexagon[] hexagons, Hexagon exception);

  /**
   * Select a player to steal from
   * 
   * @param players
   *            list of players that you could steal from
   * @return the index of the player to steal from
   */
  public int steal(Player[] players);

  /**
   * Consider trading "type" to "player" for "offer"
   * 
   * @param player
   *            the player proposing the trade
   * @param type
   *            the type that the player wants
   * @param offer
   *            how many of each resource the player is offering
   * @return the offer (to accept), a counter-offer, or null (to reject)
   */
  public int[] offerTrade(Player player, Hexagon.Type type, int[] offer);

  /**
   * Instruct the player to discard resources
   * 
   * @note use Player.discard() via super
   * 
   * @param quantity
   *            the number of resources that must be discarded
   */
  public void discard(int quantity);
}




Java Source Code List

com.settlers.hd.AcceptTrade.java
com.settlers.hd.AutomatedPlayer.java
com.settlers.hd.BalancedAI.java
com.settlers.hd.Board.java
com.settlers.hd.CounterOffer.java
com.settlers.hd.Discard.java
com.settlers.hd.Edge.java
com.settlers.hd.GameActivity.java
com.settlers.hd.GameRenderer.java
com.settlers.hd.GameView.java
com.settlers.hd.Geometry.java
com.settlers.hd.Hexagon.java
com.settlers.hd.LocalGame.java
com.settlers.hd.Main.java
com.settlers.hd.PlayerTrade.java
com.settlers.hd.Player.java
com.settlers.hd.Reference.java
com.settlers.hd.ResourceView.java
com.settlers.hd.Rules.java
com.settlers.hd.Settings.java
com.settlers.hd.Settlers.java
com.settlers.hd.Square.java
com.settlers.hd.Stats.java
com.settlers.hd.Status.java
com.settlers.hd.TextureManager.java
com.settlers.hd.Trader.java
com.settlers.hd.UIButton.java
com.settlers.hd.Vertex.java