-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.ctxt
94 lines (94 loc) · 7.83 KB
/
Game.ctxt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#BlueJ class context
comment0.target=Game
comment0.text=\ \r\n\ The\ game\ class\ is\ used\ to\ describe\ the\ priciples\ of\ game\ football\ world\ cup.\r\n\ The\ method\ named\ startGame()\ is\ the\ main\ method.\r\n\ Call\ startGame()\ method\ to\ start\ the\ whole\ program.\r\n\ The\ game\ rules\ follow\ assignment\ 2\ requirements.\r\n\ Assumption\:\ Name\ of\ team\ can't\ be\ longer\ than\ 12\ characters.\r\n\r\n\ @author\ (Pan\ Qi)\r\n\ @version\ (21/05/2018)\r\n
comment1.params=
comment1.target=Game()
comment1.text=\r\n\ Default\ constructor\ for\ objects\ of\ class\ Game\r\n
comment10.params=finalAward
comment10.target=void\ goldenBootAward(java.util.ArrayList)
comment10.text=\r\n\ Select\ which\ player\ get\ golden\ boot\ award,and\ write\ the\ player's\ name\ in\ the\ record.\r\n\ \r\n\ @param\ ArrayList<StringBuffer>\ which\ is\ the\ record\ of\ awards.\r\n
comment11.params=
comment11.target=void\ ifContinue()
comment11.text=\r\n\ Ask\ user\ to\ press\ enter\ to\ continue.\r\n
comment12.params=playerName
comment12.target=boolean\ ifNameValid(java.lang.String)
comment12.text=\r\n\ Test\ if\ the\ player\ name\ is\ valid.\r\n\ \r\n\ @param\ String\ which\ is\ the\ player's\ name.\r\n\ @return\ Boolean\ true\ when\ name\ valid,false\ when\ name\ invalid.\r\n
comment13.params=
comment13.target=boolean\ ifReplay()
comment13.text=\r\n\ Ask\ user\ if\ clear\ the\ previous\ record\ and\ replay\ the\ game.\r\n\ \r\n\ @return\ Boolean\ true\ if\ user\ want\ replay,false\ if\ user\ quit\ replay.\r\n
comment14.params=
comment14.target=boolean\ ifTeamDetailsValid()
comment14.text=\r\n\ Test\ if\ team\ details\ read\ from\ file\ is\ valid.(Team's\ name\ can't\ be\ either\ same\ or\ empty,\r\n\ rankings\ can't\ be\ same\ and\ must\ between\ 1\ to\ 4.)\r\n\ \r\n\ @return\ Boolean\ true\ when\ details\ valid,false\ when\ details\ invalid.\r\n
comment15.params=
comment15.target=java.lang.String\ playFinal()
comment15.text=\r\n\ Play\ the\ final\ stage\ of\ the\ game.\r\n\ \r\n\ @return\ String\ which\ is\ the\ name\ of\ the\ team\ who\ win\ the\ final\ stage.\r\n
comment16.params=team1\ team2\ teamGoals\ randomGenerator
comment16.target=void\ playGame(Team,\ Team,\ int[],\ RandomGoalsGenerator)
comment16.text=\r\n\ Game\ play\ rules.\r\n\ \r\n\ @param\ Team\ which\ is\ the\ team\ which\ play\ in\ this\ round.\r\n\ @param\ Team\ which\ is\ the\ team\ which\ play\ in\ this\ round.\r\n\ @param\ int[]\ which\ is\ the\ collection\ of\ goals\ that\ each\ team\ get\ in\ this\ game.\r\n\ @param\ RandomGoalsGenerator\ which\ can\ randomly\ generate\ goals\ of\ each\ team.\r\n
comment17.params=teamGoals\ randomGenerator
comment17.target=void\ playPenaltyShootOut(int[],\ RandomGoalsGenerator)
comment17.text=\r\n\ Play\ penalty\ shoot\ out\ stage.\r\n\ \r\n\ @param\ int[]\ which\ is\ the\ collection\ of\ goals\ that\ each\ team\ get\ in\ this\ game.\r\n\ @param\ RandomGoalsGenerator\ which\ can\ randomly\ generate\ goals\ of\ each\ team.\r\n
comment18.params=
comment18.target=void\ playPreStage()
comment18.text=\r\n\ Play\ preliminary\ stage\ of\ the\ game.\r\n
comment19.params=lineLength
comment19.target=void\ printDividingLine(int)
comment19.text=\r\n\ Print\ hyphen\ as\ a\ line\ of\ the\ output\ table.\r\n\ \r\n\ @param\ Integer\ which\ is\ the\ length\ of\ dividing\ line.\r\n
comment2.params=list
comment2.target=Game(java.util.ArrayList)
comment2.text=\r\n\ Constructor\ for\ objects\ of\ class\ Game\r\n\ \r\n\ @param\ ArrayList<Team>\ which\ is\ the\ collection\ of\ teams.\r\n
comment20.params=
comment20.target=void\ printWelcome()
comment20.text=\r\n\ Output\ welcome\ to\ user.\r\n
comment21.params=
comment21.target=void\ rankTeam()
comment21.text=\r\n\ Rank\ the\ order\ of\ teams\ in\ the\ teamList\ with\ higher\ points\ higher\ position,\r\n\ if\ same\ points\ higher\ team\ goals\ higher\ position.\r\n
comment22.params=fileName
comment22.target=void\ readTeamDetails(java.lang.String)
comment22.text=\r\n\ Read\ team\ details\ from\ file.\r\n\ \r\n\ @param\ String\ which\ is\ the\ name\ of\ the\ file\ that\ will\ be\ read.\r\n
comment23.params=teamName
comment23.target=java.util.ArrayList\ setFinalAwards(java.lang.String)
comment23.text=\r\n\ Collection\ of\ final\ awards.\r\n\ \r\n\ @param\ String\ which\ is\ the\ name\ of\ team\ who\ win\ the\ cup.\r\n
comment24.params=team1\ team2\ teamGoals\ randomGenerator
comment24.target=void\ setGameResult(Team,\ Team,\ int[],\ RandomGoalsGenerator)
comment24.text=\r\n\ Set\ game\ result\ of\ each\ team.\r\n\ \r\n\ @param\ Team\ which\ is\ the\ team\ who\ played\ in\ this\ game.\r\n\ @param\ Team\ which\ is\ the\ team\ who\ played\ in\ this\ game.\r\n\ @param\ int[]\ which\ is\ the\ collection\ of\ goals\ of\ teams\ played\ in\ the\ game.\r\n\ @param\ RandomGoalsGenerator\ which\ is\ an\ object\ of\ RandomGoalsGenerator\ class.\r\n
comment25.params=team\ teamGoals\ playerGoals
comment25.target=void\ setPlayerGoals(Team,\ int,\ int)
comment25.text=\r\n\ Set\ goals\ of\ each\ player\ of\ the\ team.\r\n\ \r\n\ @param\ Team\ whiich\ is\ the\ team\ whose\ players'\ goals\ will\ be\ set.\r\n\ @param\ Integer\ which\ is\ the\ goals\ of\ the\ team.\r\n\ @param\ Inteeger\ which\ is\ the\ goals\ of\ one\ player.\r\n
comment26.params=
comment26.target=void\ setPlayerName()
comment26.text=\r\n\ Let\ user\ input\ the\ name\ of\ each\ player.\r\n
comment27.params=
comment27.target=void\ setTeamDetails()
comment27.text=\r\n\ Set\ team\ details\ and\ initialize\ teamList\ and\ playerList.\r\n
comment28.params=list
comment28.target=void\ setTeamList(java.util.ArrayList)
comment28.text=\r\n\ Set\ teamList.\r\n\ \r\n\ @param\ ArrayList<Team>\ which\ is\ the\ collection\ of\ teams.\r\n
comment29.params=
comment29.target=void\ startGame()
comment29.text=\r\n\ This\ method\ is\ used\ to\ start\ playing\ the\ whole\ game.\r\n
comment3.params=randomGenerator\ team
comment3.target=void\ awardTeamCards(RandomGoalsGenerator,\ Team)
comment3.text=\r\n\ Randomly\ generate\ if\ a\ team\ have\ a\ red\ card\ or\ yellow\ card\ in\ the\ game.\r\n\ Then\ output\ the\ result.\r\n\ \r\n\ @param\ RandomGoalsGenerator\ which\ is\ an\ object\ of\ RandomGoalsGenerator\ class.\r\n\ @param\ Team\ which\ is\ an\ object\ of\ Team\ class\ that\ indicate\ which\ award\ cards\ to\ which\ team.\r\n
comment30.params=teamName
comment30.target=void\ writeCupResult(java.lang.String)
comment30.text=\r\n\ Write\ cup\ result\ to\ a\ file\ called\ "statistics.txt".\r\n\ \r\n\ @param\ String\ which\ is\ the\ name\ of\ team\ who\ win\ the\ cup.\r\n
comment4.params=
comment4.target=void\ displayCupResult()
comment4.text=\r\n\ Display\ the\ game\ result\ of\ each\ team.\r\n
comment5.params=teamName
comment5.target=void\ displayFinalAwards(java.lang.String)
comment5.text=\r\n\ Display\ the\ final\ awards\ the\ the\ whole\ game.\r\n
comment6.params=randomGenerator\ team1\ team2\ teamGoals
comment6.target=void\ displayGameResult(RandomGoalsGenerator,\ Team,\ Team,\ int[])
comment6.text=\r\n\ Display\ the\ game\ result\ of\ each\ game.\r\n\ \r\n\ @param\ RandomGoalsGenerator\ which\ is\ an\ object\ of\ RandomGoalsGenerator\ class.\r\n\ @param\ Team\ which\ is\ the\ team\ who\ played\ in\ this\ game.\r\n\ @param\ Team\ which\ is\ the\ team\ who\ played\ in\ this\ game.\r\n\ @param\ Collection\ of\ intgers\ which\ is\ the\ collection\ of\ goals\ of\ teams\ played\ in\ the\ game.\r\n
comment7.params=
comment7.target=void\ displayPlayer()
comment7.text=\r\n\ Display\ the\ name,\ team\ and\ total\ goals\ of\ each\ player.\r\n
comment8.params=finalAward
comment8.target=void\ fairPlayAward(java.util.ArrayList)
comment8.text=\r\n\ Select\ which\ team\ get\ fair\ play\ award,and\ add\ the\ team\ name\ to\ String\ Buffer.\r\n\ \r\n\ @param\ ArrayList<StringBuffer>\ which\ is\ the\ record\ of\ awards.\r\n
comment9.params=
comment9.target=java.util.ArrayList\ getTeamList()
comment9.text=\r\n\ Get\ collection\ of\ teams.\r\n\ \r\n\ @return\ ArrayList<Team>\ which\ is\ the\ collection\ of\ teams.\r\n
numComments=31