Skip to content

Create story class holding passages with tests

Carl Gützkow requested to merge create-story into main

closes: #3 (closed)

What are the key features of this change

A story holds the graph of all passages and the links to them. No two created stories are the same as there is no overridden equals method. The HashMap containing the links and passages is private, but a collection of passages is accessible through the getPassages method. It is also possible to get a single passage through a link. Remember that two links are the same if their title is the same. Therefore it is possible to get a passage by creating a new link with the correct title. Tests for all cases of input into the constructor is added with more. There is also a method for checking if a story is playable which it is if there exists an opening passage and that passage is contained in the passages map. This method is also tested.

Checklist

  • Javadoc
  • Relevant tests have been created
  • Build tool test passed
  • Class version is updated where relevant

Merge request reports

Loading