-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.ctxt
More file actions
53 lines (53 loc) · 6.15 KB
/
Game.ctxt
File metadata and controls
53 lines (53 loc) · 6.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#BlueJ class context
comment0.params=
comment0.target=java.lang.String\ getName()
comment0.text=Returns\ the\ name\ of\ the\ player\ \r\n\ @return\ the\ name\ of\ the\ player\ \r\n
comment1.params=
comment1.target=java.lang.String\ toString()
comment1.text=Returns\ a\ String\ representation\ of\ the\ state\ of\ the\ game,\r\n\ including\ the\ name\ of\ the\ player,\ state\ of\ the\ treasury,whether\ \r\n\ player\ has\ lost\ or\ is\ still\ OK,\ and\ the\ champions\ in\ the\ army\ \r\n\ (or,\ "No\ champions"\ if\ army\ is\ empty)\r\n\ @return\ a\ String\ representation\ of\ the\ state\ of\ the\ game,\r\n\ including\ the\ name\ of\ the\ player,\ state\ of\ the\ treasury,\ whether\ \r\n\ player\ has\ lost\ or\ is\ still\ OK,\ and\ the\ champions\ in\ the\ army\ \r\n\ (or,\ "No\ champions"\ if\ army\ is\ empty)\r\n
comment10.params=name
comment10.target=boolean\ restoreChampion(java.lang.String)
comment10.text=Restores\ a\ resting\ champion\ to\ the\ army\ by\ setting\ their\ state\ \r\n\ to\ ACTIVE\ at\ a\ cost\ of\ 50\ gulden.\r\n\ pre-condition\:\ isInArmy(name)\ and\ champion\ is\ resting\r\n\ @param\ the\ name\ of\ the\ champion\ to\ be\ restored\r\n\ @return\ true\ if\ restored,\ else\ false\r\n
comment11.params=num
comment11.target=boolean\ isChallenge(int)
comment11.text=\ returns\ true\ if\ the\ number\ represents\ a\ challenge\r\n\ @param\ num\ is\ the\ reference\ number\ of\ the\ challenge\r\n\ @returns\ true\ if\ the\ reference\ number\ represents\ a\ challenge\r\n
comment12.params=challNo
comment12.target=java.lang.String\ meetChallenge(int)
comment12.text=\ Meets\ the\ challenge\ represented\ by\ the\ challenge\ number\ (or\ returns\ \r\n\ "\ -\ no\ such\ challenge").Find\ a\ champion\ from\ the\ army\ who\ can\ meet\ the\ \r\n\ challenge\ and\ return\ a\ result\ which\ is\ one\ of\ the\ following\:\ \u201CChallenge\ \r\n\ won\ by...\u201C\ \u2013\ add\ reward\ to\ treasury,\ set\ the\ champion\ to\ restingand\ add\ \r\n\ the\ name\ of\ champion,\ \u201CChallenge\ lost\ as\ no\ champion\ available\u201D\ \u2013\ deduct\ \r\n\ reward\ from\ treasury,\u201CChallenge\ lost\ on\ skill\ level\u201D-\ deduct\ reward\ from\ \r\n\ treasury,\ the\ champion\ is\ killed,\ so\ add\ "<champion\ name>\ is\ dead"\ to\ the\ \r\n\ return\ String.\ If\ the\ challenge\ is\ lost\ and\ there\ is\ no\ money\ left,\ add\ \r\n\ "You\ have\ NO\ money\ in\ the\ treasury".\r\n\ @param\ challNo\ is\ the\ reference\ number\ of\ the\ challenge\r\n\ @return\ a\ String\ showing\ the\ result\ of\ meeting\ the\ challenge\r\n
comment13.params=num
comment13.target=java.lang.String\ getChallenge(int)
comment13.text=\ Provides\ a\ String\ representation\ of\ a\ challenge\ given\ by\ challenge\ number\r\n\ pre-condition\ isChallenge(num)\r\n\ @param\ num\ the\ number\ of\ the\ challenge\r\n\ @return\ returns\ a\ String\ representation\ of\ a\ challenge\ given\ by\ \r\n\ the\ challenge\ number\r\n
comment14.params=
comment14.target=java.lang.String\ getAllChallenges()
comment14.text=\ Provides\ a\ String\ representation\ of\ all\ challenges\ \r\n\ @return\ returns\ a\ String\ representation\ of\ of\ all\ challenges\r\n
comment15.params=filename
comment15.target=void\ saveGame(java.lang.String)
comment15.text=\r\n\ Saves\ the\ state\ of\ the\ game\ to\ the\ file\ with\ the\ given\ name\ \r\n\ @param\ filename\ the\ name\ of\ the\ file\ \r\n
comment16.params=filename
comment16.target=Game\ restoreGame(java.lang.String)
comment16.text=\ \r\n\ Restores\ the\ game\ from\ the\ file\ with\ the\ given\ name\r\n\ @param\ filename\ the\ name\ of\ the\ file\ \r\n
comment2.params=
comment2.target=int\ getMoney()
comment2.text=\ returns\ the\ amount\ of\ money\ in\ the\ treasury\r\n\ @returns\ the\ amount\ of\ money\ in\ the\ treasury\r\n
comment3.params=
comment3.target=boolean\ hasLost()
comment3.text=\ returns\ true\ if\ treasury\ <\=0\ and\ the\ army\ has\ no\ champions\ \r\n\ who\ can\ be\ dismissed.\ \r\n\ @returns\ true\ if\ treasury\ <\=0\ and\ the\ army\ has\ no\ champions\ \r\n\ who\ can\ be\ dismissed.\ \r\n
comment4.params=
comment4.target=java.lang.String\ getAllChampionsForHire()
comment4.text=Returns\ a\ String\ representation\ of\ all\ champions\ available\ for\ hire\r\n\ @return\ a\ String\ representation\ of\ all\ champions\ available\ for\ hire\r\n
comment5.params=name
comment5.target=java.lang.String\ getChampion(java.lang.String)
comment5.text=\ Returns\ details\ of\ a\ champion\ with\ the\ given\ name\r\n\ @return\ details\ of\ a\ champion\ with\ the\ given\ name\r\n
comment6.params=name
comment6.target=java.lang.String\ hireChampion(java.lang.String)
comment6.text=\ Allows\ a\ champion\ to\ be\ hired\ for\ the\ army,\ if\ there\ \r\n\ is\ enough\ money\ in\ the\ treasury\ for\ their\ hire\ fee.The\ champion's\ \r\n\ state\ is\ set\ to\ "active"\r\n\ @param\ name\ is\ the\ name\ of\ the\ champion\r\n\ @return\ name\ and\ either\ "-\ not\ found"\ if\ champion\ not\ found,or\ "-\ cannot\ \r\n\ be\ hired"\ if\ champion\ is\ not\ for\ hire,already\ hired/dead,\ "-\ hired\ and\ \r\n\ avialable"\ if\ champion\ hired,\ "-\ not\ enough\ money"\ if\ not\ enough\ money\r\n\ in\ the\ treasury\r\n
comment7.params=
comment7.target=java.lang.String\ getArmy()
comment7.text=Returns\ a\ String\ representation\ of\ the\ champions\ in\ the\ player's\ army\r\n\ with\ an\ appropriate\ header,\ or\ the\ message\ "No\ champions\ hired"\r\n\ @return\ a\ String\ representation\ of\ the\ champions\ in\ the\ player's\ army\r\n
comment8.params=name
comment8.target=boolean\ isInArmy(java.lang.String)
comment8.text=\ Returns\ true\ if\ the\ champion\ with\ the\ name\ is\ in\ the\ player's\ army,\ \r\n\ false\ otherwise.\r\n\ @param\ name\ is\ the\ name\ of\ the\ champion\r\n\ @return\ true\ if\ the\ champion\ with\ the\ name\ is\ in\ the\ player's\ army,\ \r\n\ false\ otherwise.\r\n
comment9.params=name
comment9.target=boolean\ dismissChampion(java.lang.String)
comment9.text=\ Dismisses\ a\ champion\ from\ the\ army\ and\ add\ half\ of\ their\ hire\ fee\ \r\n\ to\ the\ treasury.Champion\ must\ be\ active\ or\ resting.Champion\ should\r\n\ now\ be\ for\ hire.\r\n\ pre-condition\:\ isInArmy(name)and\ is\ not\ dead\r\n\ @param\ name\ is\ the\ name\ of\ the\ champion\r\n\ @return\ true\ if\ dismissed,\ else\ false\r\n
numComments=17