// 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 java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import org.iaie.btree.util.GameHandler;
import bwta.BWTA;
import bwta.BaseLocation;
import bwta.Chokepoint;
import bwapi.Color;
import bwapi.Game;
import bwapi.Order;
import bwapi.Player;
import bwapi.Position;
import bwapi.Unit;
import bwapi.Race;
import bwapi.TilePosition;
import bwapi.UnitType;
import bwapi.UpgradeType;

	}
	
	/**
	 * Train an unit. 
	 * @param building
	 * @param unit
	 * @return true if can train the unit, false if not
	 */
	public boolean trainUnit(UnitType building, UnitType unit){
		for (Unit u : finishedBuildings){
			if (u.getType().equals(building) &&
					u.isCompleted() &&
					!u.isTraining()){
				if (u.train(unit)) {
					mineral -= unit.mineralPrice();
					vespin_gas -= unit.gasPrice();
					return false;
				}
			}
		}
		return false;
	}
	
	/**
	 * Move a SCV to the "posBuild" position
	 * @return True if can move the SCV, false if not
	 */
	public boolean moveTo() {
		if (workers.get(0) != null && !workers.get(0).getOrderTargetPosition().equals(posBuild.toPosition())){
			if (workers.get(0).getTilePosition().getDistance(posBuild) > 13)

// 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/JohnDoe.java
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import org.iaie.btree.util.GameHandler;
import bwta.BWTA;
import bwta.BaseLocation;
import bwta.Chokepoint;
import bwapi.Color;
import bwapi.Game;
import bwapi.Order;
import bwapi.Player;
import bwapi.Position;
import bwapi.Unit;
import bwapi.Race;
import bwapi.TilePosition;
import bwapi.UnitType;
import bwapi.UpgradeType;

	}
	
	/**
	 * Train an unit. 
	 * @param building
	 * @param unit
	 * @return true if can train the unit, false if not
	 */
	public boolean trainUnit(UnitType building, UnitType unit){
		for (Unit u : finishedBuildings){
			if (u.getType().equals(building) &&
					u.isCompleted() &&
					!u.isTraining()){
				if (u.train(unit)) {
					mineral -= unit.mineralPrice();
					vespin_gas -= unit.gasPrice();
					return false;
				}
			}
		}
		return false;
	}
	
	/**
	 * Move a SCV to the "posBuild" position
	 * @return True if can move the SCV, false if not
	 */
	public boolean moveTo() {
		if (workers.get(0) != null && !workers.get(0).getOrderTargetPosition().equals(posBuild.toPosition())){
			if (workers.get(0).getTilePosition().getDistance(posBuild) > 13)

				return workers.get(0).move(posBuild.toPosition().makeValid(), false);
