public void objectClicked(chCtrl.CharacterController _ch) { if (_ch.isOnBoat()) //obj is on boat { LandController land; if (boat.getState() == -1) { land = endLand; } else { land = startLand; } boat.getOffBoat(_ch.getName()); _ch.movePos(land.getEmptyPlace()); _ch.getOnLand(land); land.addObj(_ch); } else //obj is on land { LandController land = _ch.getLandController(); if (boat.getEmptyNum() == -1) { return; //full boat } if (land.getState() != boat.getState()) { return; //different side } land.removeObj(_ch.getName()); _ch.movePos(boat.getEmptyPlace()); _ch.getOnBoat(boat); boat.getOnBoat(_ch); } userGUI.status = check(); }