Examples of GameStateClone


Examples of wholaughs.game.GameStateClone

  {
    List<Integer> options = state.columnsWithFreeCapacity();
   
    for( Integer i : options )
    {
      GameStateClone clone = state.clone();
      clone.insertStone( options.get( i ), this );
      if( clone.isGameOver(settings) == this.getColour() )
      {
        return i;
      }
    }
   
View Full Code Here

Examples of wholaughs.game.GameStateClone

    super()
 
   
  protected void myFirstTurn( GameState state, GameSettings settings )
  {
    GameStateClone clone = state.clone();
    if( maxLevel > 0 )
    {
      int level = 1;
      for( Integer i : optionQuality.keySet() )
      {
        clone.insertStone( i, this );
        if( clone.isGameOver(settings, i) == this.getColour() )
        {
          optionQuality.get( i ).increaseQuality( factor / Math.pow( settings.getColumns(), level - 1 ) );
          break;
       
        if( level < maxLevel )
        {
          this.opponentTurn( clone, level + 1, i, settings );
        }
        clone.removeStone( i );
      }
    }
  }
View Full Code Here

Examples of wholaughs.game.GameStateClone

    if( maxLevel > 0 )
    {
      int level = 1;
      for( Integer i : optionQuality.keySet() )
      {
        GameStateClone clone = state.clone();
        clone.insertStone( i, this );
        if( clone.isGameOver(settings) == this.getColour() )
        {
          optionQuality.get( i ).increaseQuality( factor / Math.pow( settings.getColumns(), level - 1 ) );
          break;
       
        if( level < maxLevel )
View Full Code Here

Examples of wholaughs.game.GameStateClone

  protected void myTurn( GameStateClone state, int level, int option, GameSettings settings  )
  {
    for( Integer i : state.columnsWithFreeCapacity() )
    {
      GameStateClone clone = state.clone();
      clone.insertStone( i, this );
      if( clone.isGameOver(settings) == this.getColour() )
      {
        optionQuality.get( option ).increaseQuality( factor / Math.pow( settings.getColumns(), level - 1 ) );
     
      if( level < maxLevel )
      {
View Full Code Here

Examples of wholaughs.game.GameStateClone

  protected void opponentTurn( GameStateClone state, int level, int option, GameSettings settings  )
  {
    for( Integer i : state.columnsWithFreeCapacity() )
    {
      GameStateClone clone = state.clone();
      clone.insertStone( i, opponentColor() );
      if( clone.isGameOver(settings) != this.getColour() && clone.isGameOver(settings) != -1 )
      {
        optionQuality.get( option ).decreaseQuality( factor / Math.pow( settings.getColumns(), level - 1 ) );
      }     
      if( level < maxLevel )
      {
View Full Code Here

Examples of wholaughs.game.GameStateClone

    private GameState state;
    private int option = -1;
    public Object call() throws Exception
    {
      int level = 1;
      GameStateClone clone = state.clone();
      clone.insertStone( option, duncan );
      if( clone.isGameOver(settings) == duncan.getColour() )
      {
        duncan.optionQuality.get( option ).increaseQuality( duncan.factor / Math.pow( settings.getColumns(), level - 1 ) );
     
      if( level < duncan.maxLevel )
      {
View Full Code Here
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.