Android Open Source - BoardGameDirector Game Action






From Project

Back to project page BoardGameDirector.

License

The source code is released under:

GNU General Public License

If you think the Android project BoardGameDirector 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.dilph.bgd.engine;
//w  w w .  j  a v  a 2 s.  c o  m
/**
 * Created with IntelliJ IDEA.
 * User: pseudo
 * Date: 8/3/13
 * Time: 11:10 AM
 * To change this template use File | Settings | File Templates.
 */

/**
 *  An action represents something a player most do.
 */
public class GameAction extends BaseEvent implements TurnEvent {


    private TurnEvent nextTurnEvent;
    private CounterAction counterAction;

    public GameAction(String message, TurnEvent nextTurnEvent) {
        super(message);
        this.nextTurnEvent = nextTurnEvent;
    }

    public GameAction(String message, TurnEvent nextTurnEvent, CounterAction counterAction) {
        super(message);
        this.nextTurnEvent = nextTurnEvent;
        this.counterAction = counterAction;
    }

    @Override
    public TurnEvent getNext(boolean response) {
        doAction();
        return nextTurnEvent;  //To change body of implemented methods use File | Settings | File Templates.
    }

    private void doAction() {
        if(counterAction != null)   {
            counterAction.doAction();
        }

    }


}




Java Source Code List

com.dilph.bgd.engine.BaseEvent.java
com.dilph.bgd.engine.CounterAction.java
com.dilph.bgd.engine.CounterCondition.java
com.dilph.bgd.engine.CounterManager.java
com.dilph.bgd.engine.Counter.java
com.dilph.bgd.engine.Decision.java
com.dilph.bgd.engine.EndTurnEvent.java
com.dilph.bgd.engine.GameAction.java
com.dilph.bgd.engine.GameManager.java
com.dilph.bgd.engine.Player.java
com.dilph.bgd.engine.TurnEvent.java
com.dilph.bgd.engine.Turn.java
com.dilph.bgd.front.BoardGameDirector.java
com.dilph.bgd.front.MainMenu.java
com.dilph.bgd.front.PlayerManagement.java