Package org.freerealm.executor

Examples of org.freerealm.executor.CommandResult.addParameter()


     * @return CommandResult
     */
    public CommandResult execute(Realm realm) {
        realm.getWorldMap().getTile(coordinate).setVegetation(vegetation);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.VEGETATION_CHANGED_UPDATE);
        commandResult.addParameter(coordinate);
        return commandResult;
    }
}
View Full Code Here


        float newMovementPoints = (unit.getMovementPoints() >= movementCost ? unit.getMovementPoints() - movementCost : 0);
        unit.setMovementPoints(newMovementPoints);
        manageExploration(realm);
        manageDiplomacy(realm);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.UNIT_MOVEMENT_UPDATE);
        commandResult.addParameter(unit);
        commandResult.addParameter(oldCoordinate);
        commandResult.addParameter(coordinate);
        return commandResult;
    }
View Full Code Here

        unit.setMovementPoints(newMovementPoints);
        manageExploration(realm);
        manageDiplomacy(realm);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.UNIT_MOVEMENT_UPDATE);
        commandResult.addParameter(unit);
        commandResult.addParameter(oldCoordinate);
        commandResult.addParameter(coordinate);
        return commandResult;
    }

    private void manageExploration(Realm realm) {
View Full Code Here

        manageExploration(realm);
        manageDiplomacy(realm);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.UNIT_MOVEMENT_UPDATE);
        commandResult.addParameter(unit);
        commandResult.addParameter(oldCoordinate);
        commandResult.addParameter(coordinate);
        return commandResult;
    }

    private void manageExploration(Realm realm) {
        unit.getPlayer().addExploredCoordinate(unit.getCoordinate());
View Full Code Here

        settlement.setPopulation(cityFoundingPopulation);
        unit.getPlayer().addSettlement(settlement);
        Executor.getInstance().execute(new RemoveUnitCommand(unit.getPlayer(), unit));
        realm.getWorldMap().addSettlement(settlement);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.NEW_SETTLEMENT_UPDATE);
        commandResult.addParameter(settlement);
        return commandResult;
    }

    private BuildCity getBuildCityProperty(Unit unit) {
        Iterator<Property> propertyIterator = unit.getType().getPropertiesIterator();
View Full Code Here

     */
    public CommandResult execute(Realm realm) {
        mission.setPlayer(player);
        player.addMission(mission);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.MISSION_ASSIGNED_UPDATE);
        commandResult.addParameter(player);
        commandResult.addParameter(mission);
        return commandResult;
    }
}
View Full Code Here

    public CommandResult execute(Realm realm) {
        mission.setPlayer(player);
        player.addMission(mission);
        CommandResult commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.MISSION_ASSIGNED_UPDATE);
        commandResult.addParameter(player);
        commandResult.addParameter(mission);
        return commandResult;
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.