crossButton = new Button(this, SWT.NONE);
crossButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
River river = World.getMap().getLastRiver();
if(river == null)
river = World.getMap().getNextRiver(); //backup for the first river
if(crossMethods.getText().equals("Take Ferry"))
{
try
{
river.takeFerry();
done = true;
}
catch(InsufficientFundsException f)
{
lblCross.setText("We're too poor for that, pick another way across.");
}
}
else if(crossMethods.getText().equals("Ford")){
river.ford();
done = true;
}
else{
river.caulk();
done = true;
}
}
});
crossButton.setBounds(209, 256, 231, 34);