Refactored the switch case statement into state pattern for ships
movement