|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Page
public class Page
This class represents one Page of a game book. It has a page number, a description of the story and up to three Choices for the user.
Constructor Summary | |
---|---|
Page(int pageNumber,
java.lang.String text)
This constructor is for making pages that have only no Choices. |
|
Page(int pageNumber,
java.lang.String text,
Choice option1)
This constructor is for making pages that have only one Choices |
|
Page(int pageNumber,
java.lang.String text,
Choice option1,
Choice option2)
This constructor is for making pages that have two Choices |
|
Page(int pageNumber,
java.lang.String text,
Choice option1,
Choice option2,
Choice option3)
This constructor is for making pages that have three Choices |
Method Summary | |
---|---|
Choice |
getChoice(int i)
Get the Choice that has the number i. |
int |
getPageNumber()
Get the page number |
java.lang.String |
getText()
Get the part of the story that's on this Page |
boolean |
isEndOfStory()
Returns true if there if this is an ending to the story. |
void |
printText()
Causes the Page to print itself to System.out. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Page(int pageNumber, java.lang.String text, Choice option1, Choice option2, Choice option3)
pageNumber
- the page numbertext
- the part of the story that's on this pageoption1
- the first Choiceoption2
- the second choiceoption3
- the third choicepublic Page(int pageNumber, java.lang.String text, Choice option1, Choice option2)
pageNumber
- the page numbertext
- the part of the story that's on this pageoption1
- the first Choiceoption2
- the second choicepublic Page(int pageNumber, java.lang.String text, Choice option1)
pageNumber
- the page numbertext
- the part of the story that's on this pageoption1
- the only Choicepublic Page(int pageNumber, java.lang.String text)
pageNumber
- the page numbertext
- the part of the story that's on this pageMethod Detail |
---|
public int getPageNumber()
public java.lang.String getText()
public void printText()
public boolean isEndOfStory()
public Choice getChoice(int i)
i
- the number if the Choice we want to get.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |