Search in sources :

Example 1 with AbstractPlaceDelegate

use of games.strategy.triplea.delegate.AbstractPlaceDelegate in project triplea by triplea-game.

the class ProPurchaseUtils method canUnitsBePlaced.

public static boolean canUnitsBePlaced(final List<Unit> units, final PlayerID player, final Territory t, final boolean isBid) {
    final GameData data = ProData.getData();
    AbstractPlaceDelegate placeDelegate = (AbstractPlaceDelegate) data.getDelegateList().getDelegate("place");
    if (isBid) {
        placeDelegate = (AbstractPlaceDelegate) data.getDelegateList().getDelegate("placeBid");
    }
    final IDelegateBridge bridge = new ProDummyDelegateBridge(ProData.getProAi(), player, data);
    placeDelegate.setDelegateBridgeAndPlayer(bridge);
    final String s = placeDelegate.canUnitsBePlaced(t, units, player);
    return s == null;
}
Also used : GameData(games.strategy.engine.data.GameData) ProDummyDelegateBridge(games.strategy.triplea.ai.pro.simulate.ProDummyDelegateBridge) AbstractPlaceDelegate(games.strategy.triplea.delegate.AbstractPlaceDelegate) IDelegateBridge(games.strategy.engine.delegate.IDelegateBridge)

Aggregations

GameData (games.strategy.engine.data.GameData)1 IDelegateBridge (games.strategy.engine.delegate.IDelegateBridge)1 ProDummyDelegateBridge (games.strategy.triplea.ai.pro.simulate.ProDummyDelegateBridge)1 AbstractPlaceDelegate (games.strategy.triplea.delegate.AbstractPlaceDelegate)1