public void CharacterIsClicked(ICharacterController characterController) { if (characterController.IsOnBoat()) { CoastController whichCoast; if (boat.Get_to_or_from() == -1) // to -1; from 1 { whichCoast = toCoast; } else { whichCoast = fromCoast; } boat.GetOffBoat(characterController.GetName()); characterController.MoveToPosition(whichCoast.GetEmptyPosition()); characterController.GetOnCoast(whichCoast); whichCoast.GetOnCoast(characterController); } else { CoastController whichCoast = characterController.GetCoastController(); if (boat.GetEmptyIndex() == -1) { return; } if (whichCoast.GetToOrFrom() != boat.Get_to_or_from()) { return; } whichCoast.GetOffCoast(characterController.GetName()); characterController.MoveToPosition(boat.GetEmptyPosition()); characterController.GetOnBoat(boat); boat.GetOnBoat(characterController); } userUI.status = CheckGameOver(); }