Newer
Older
HelloAndroid / RiverCrossingAI / src / sample / game / model / title / LevelButton.java
package sample.game.model.title;

import library.core.listener.OnCoreTouchUpListener;
import library.core.mainAI.RiverCrossingAI;
import library.core.model.CoreModel;
import library.core.system.CoreImageData;
import sample.game.controller.TitleController;
import sample.game.controller.TitleController.Level;

public class LevelButton extends CoreModel implements OnCoreTouchUpListener{

	private TitleController controller;
	private Level level;

	private boolean canUse=true;

	public LevelButton(Level level,TitleController controller,CoreImageData imageData, float centerX, float centerY,
			float width, float height) {
		super(imageData, centerX, centerY, width, height);

		this.level=level;
		this.controller=controller;

		this.canUse=true;
	}



	@Override
	public void onTouchUp() {
		if(canUse){
			RiverCrossingAI.getSePlayer().play(1);
			canUse=false;
			controller.selectLevet(level);
		}
	}


	/**
	 * ボタンの有効化
	 * @param canUse
	 */
	public void setCanUse(boolean canUse) {
		this.canUse = canUse;
	}




}