|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object planty.Panel
public class Panel
The UI to handle a single plant.
Field Summary | |
---|---|
private int |
abs_day
The absolute day of the game. |
private boolean |
can_harvest
If the user can harvest yet. |
private int |
day
The current day of the current month (ranges from 0 to days_by_month). |
private static int |
days_by_month
The number of days in each month. |
private int |
inventory
The number of fruits in your possession. |
private boolean |
keep_on
If the program must keep on. |
private int |
month
The current month (ranges from 0 to season.length). |
private Sprouling |
plant
The plant. |
private boolean |
plant_exists
If there is a plant created. |
private java.util.Random |
rnd
The pseudorandom number generator. |
private static java.lang.String[] |
season
Seasons names. |
private boolean |
shorty
Whether the program should use the short version of the menu or not. |
private double |
talk_bonus
When it reaches 1d , the plant's health heals by one. |
private boolean |
watering
The state of watering of the plant for the day. |
private Weather |
weather
The weather. |
private int |
year
The current year (starts from 0). |
Constructor Summary | |
---|---|
Panel()
Constructor method. |
Method Summary | |
---|---|
private void |
cheat_KILL()
Cheat option, avaiable only with certain key commands. |
private void |
cheat_MOTHERLODE()
Cheat option, avaiable only with certain key commands. |
private void |
cheat_TOTAL_HEAL()
Cheat option, avaiable only with certain key commands. |
private void |
check_choice()
Checks the choice from the options menu. |
private void |
createPlant()
Procedure to create a plant. |
private void |
echo()
Prints an empty line in the default PrintStream . |
private void |
echo(java.lang.Object o)
Prints the given content. |
private void |
echoErr(java.lang.Object o)
Prints something to the default error PrintStream . |
private void |
exit()
Exit (X) choice. |
private void |
harvest()
Harvest crops (H) choice. |
private void |
inventory()
Check inventory (I) option. |
private void |
loadPlant()
Procedure to load a plant either from a list of possible precreated plants or from a file. |
static void |
main(java.lang.String[] args)
The execution method. |
private void |
medicine()
Apply medicine (M) option. |
private void |
menu()
The game's full main menu. |
private void |
next_day()
Go to next day (G) option. |
private void |
ops()
Error choice -when no other choice fits-. |
private java.lang.String |
options(int col_num)
Formats the options to display. |
private void |
plantDied()
Procedure to run when plant dies. |
private java.lang.String |
read()
Executes a line-reading of the default InputStream . |
private int |
readInt()
Runs the read() method and converts the input to int format. |
private void |
save()
Save (S) choice. |
private void |
see_details()
See plant details (S) choice. |
private void |
setDate()
Sets the date variables to a new day, based only on the game's abs_day . |
private void |
short_menu()
The game's short main menu. |
private java.lang.String |
simple_options()
Formats the options to display with only the "hotletters". |
private void |
talk()
Talk to it (T) choice. |
private void |
water()
Water (W) choice. |
private boolean |
yes()
Reades the default InputStream for an "yes" or "no". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean keep_on
private boolean shorty
private boolean plant_exists
private boolean can_harvest
private Sprouling plant
private Weather weather
private java.util.Random rnd
private int abs_day
private int day
private int month
private int year
private static final int days_by_month
private static final java.lang.String[] season
private int inventory
private boolean watering
private double talk_bonus
1d
, the plant's health heals by one.
Constructor Detail |
---|
public Panel()
Method Detail |
---|
private java.lang.String read()
InputStream
.
null
in case of error.private int readInt()
read()
method and converts the input to int
format.
private boolean yes()
InputStream
for an "yes" or "no".
false
if the user input "n", true
otherwise.private void echo()
PrintStream
.
private void echo(java.lang.Object o)
o
- something to print.private void echoErr(java.lang.Object o)
PrintStream
.
o
- the thing to print.private void createPlant()
private void loadPlant()
private void plantDied()
private void setDate()
abs_day
.
private java.lang.String options(int col_num)
col_num
- number of columns of the formatation.
n
columns aspect.private java.lang.String simple_options()
private void check_choice()
private void menu()
private void short_menu()
private void see_details()
private void next_day()
private void inventory()
private void water()
private void talk()
private void medicine()
private void harvest()
private void save()
private void exit()
private void ops()
private void cheat_KILL()
private void cheat_MOTHERLODE()
50000
fruits to the inventory.
private void cheat_TOTAL_HEAL()
public static void main(java.lang.String[] args)
args
- the parameters given in the command-line call: java -jar [this file] [parameters]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |