// Path: src/org/iaie/btree/state/State.java
// public enum State {
//     READY,
//     SUCCESS,
//     FAILURE,
//     RUNNING,
//     ERROR
// }
// 
// Path: src/org/iaie/btree/task/leaf/Action.java
// public abstract class Action extends Leaf {
// 
//     public Action(String name, GameHandler gh) {
//         super(name, gh);
//     }
// }
// 
// Path: src/org/iaie/btree/util/GameHandler.java
// public abstract class GameHandler {
//     protected Game connector; 
//     protected Player self;
//     
//     public GameHandler(Game bwapi, Player self) {
//         this.connector = bwapi;
//         this.self = self;
//     }
// }


import org.iaie.btree.state.State;
import org.iaie.btree.task.leaf.Action;
import org.iaie.btree.util.GameHandler;
import bwapi.UnitType;

package bot;



public class BuildAddon extends Action {

	UnitType addon;
	public BuildAddon(String name, GameHandler gh, UnitType addon) {
		super(name, gh);
		this.addon = addon;
	}

	@Override
	public State execute() {
		try {
			if (((JohnDoe)this.handler).buildAddon(addon)) {
				return State.SUCCESS;
			} else {
				return State.FAILURE;
			}
		} catch (Exception e) {
			e.printStackTrace();

// Path: src/org/iaie/btree/state/State.java
// public enum State {
//     READY,
//     SUCCESS,
//     FAILURE,
//     RUNNING,
//     ERROR
// }
// 
// Path: src/org/iaie/btree/task/leaf/Action.java
// public abstract class Action extends Leaf {
// 
//     public Action(String name, GameHandler gh) {
//         super(name, gh);
//     }
// }
// 
// Path: src/org/iaie/btree/util/GameHandler.java
// public abstract class GameHandler {
//     protected Game connector; 
//     protected Player self;
//     
//     public GameHandler(Game bwapi, Player self) {
//         this.connector = bwapi;
//         this.self = self;
//     }
// }


// Path: src/bot/BuildAddon.java
import org.iaie.btree.state.State;
import org.iaie.btree.task.leaf.Action;
import org.iaie.btree.util.GameHandler;
import bwapi.UnitType;

package bot;



public class BuildAddon extends Action {

	UnitType addon;
	public BuildAddon(String name, GameHandler gh, UnitType addon) {
		super(name, gh);
		this.addon = addon;
	}

	@Override
	public State execute() {
		try {
			if (((JohnDoe)this.handler).buildAddon(addon)) {
				return State.SUCCESS;
			} else {
				return State.FAILURE;
			}
		} catch (Exception e) {
			e.printStackTrace();

			return State.ERROR;
