Android Open Source - yahtzee4android On Cube Click Listener






From Project

Back to project page yahtzee4android.

License

The source code is released under:

GNU General Public License

If you think the Android project yahtzee4android 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.tum.yahtzee.listeners;
//from  w ww.j  a  v  a  2  s.  c om
import com.tum.yahtzee.GameController;
import com.tum.yahtzee.units.Cube;

import android.view.View;
import android.view.View.OnClickListener;

public class OnCubeClickListener implements OnClickListener {
  
  public OnCubeClickListener(int cubeId)
  {
    this.cubeId = cubeId;
  }
  
  private int cubeId;
  
  public int getCubeId()
  {
    return cubeId;
  }
  
  public void onClick(View v) {
    Cube cube = GameController.get().getCurrentPlayer().getCubes().get(cubeId);
    cube.setUsed(!cube.getUsed());
  }

}




Java Source Code List

com.tum.yahtzee.GameActivity.java
com.tum.yahtzee.GameController.java
com.tum.yahtzee.YahtzeeActivity.java
com.tum.yahtzee.listeners.OnCubeClickListener.java
com.tum.yahtzee.moves.ChanceMove.java
com.tum.yahtzee.moves.DummyMove.java
com.tum.yahtzee.moves.FourOfAKindMove.java
com.tum.yahtzee.moves.FullHouseMove.java
com.tum.yahtzee.moves.IBaseMove.java
com.tum.yahtzee.moves.LargeStraightMove.java
com.tum.yahtzee.moves.NumberMove.java
com.tum.yahtzee.moves.SmallStraightMove.java
com.tum.yahtzee.moves.ThreeOfAKindMove.java
com.tum.yahtzee.moves.YahtzeeMove.java
com.tum.yahtzee.services.MessageService.java
com.tum.yahtzee.services.MethodPointer.java
com.tum.yahtzee.units.Cube.java
com.tum.yahtzee.units.Player.java