Skip to content

Cruise ship project as part of the Manchester Codes curriculum which implements OOP, user stories and domain models, dependency injection & TDD with Jest (inc test doubles).

Notifications You must be signed in to change notification settings

greenchul/cruise-ships

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cruise Ships

About

Cruise ship project as part of the Manchester Codes curriculum which implements OOP, user stories and domain models, dependency injection & TDD with Jest (inc test doubles).

You can view the GUI version of the project here

Screenshot of project

Installation

  • Clone this repo.
  • Change in to repo directory.
  • Run NPM install.

Creating ships, ports & itineraries

All ships need itineraries and all itineraries need ports.

Creating a new port

Create an instance of the Port class and pass in the port name as an argument.

const dover = new Port("Dover");

Creating a new itinerary

Create an instance of the Itinerary class and pass in an array of Ports as an argument.

const itinerary = new Itinerary([dover, plymouth]);

Creating a new ship

Create an instance of the Ship class and pass in an Itinerary as an argument.

const ship = new Ship(itinerary);

All ships can sail, providing they are not at the last port in the itinerary.

ship.setSail();

All ships can come alongside.

ship.dock();

When alongside, the ship will be added to that ports "ships" array.

About

Cruise ship project as part of the Manchester Codes curriculum which implements OOP, user stories and domain models, dependency injection & TDD with Jest (inc test doubles).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published