Skip to content
Snippets Groups Projects
Commit 7cbf04d8 authored by Simon Barrett's avatar Simon Barrett
Browse files

Final Refactor of Module class

parent cbd02809
No related branches found
No related tags found
No related merge requests found
public class Module {
/*
This class holds the lesson objects and enables the user to pick from them. It has been designed so that it
can be replicated and extended to include Courses. This is expanded upon in the ReadMe.
*/
private Lesson[] lessons;
public Module(Lesson[] lessons) {
......@@ -10,17 +15,15 @@ public class Module {
/**
* Returns a lesson from the Lesson array depending on User input
* User starts choice at 1 rather than 0 so this needs to be translated to arrays
* User starts choice at 1 rather than 0 so this needs to be translated to arrays with base 0
* @param choice
* @return
* @return Lesson object
*/
public Lesson getLesson(int choice) {
return lessons[choice - 1];
}
/* This is only called in one place so rather than a getter and then call .length it
has been combined here for readability.
*/
// Rather than have a getter and then call .length on it, it has been combined here for readability.
public int getLessonsArrayLength() {
return lessons.length;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment