Browse Source

Javadoc/style improvements

git-svn-id: http://chris.smith.name/svn/japoker/trunk@10 b8598caf-53df-4c1b-98b8-507a84a220
tags/v12
Chris Smith 16 years ago
parent
commit
60b9ebb738

+ 26
- 1
src/com/md87/cardgame/controllers/NetworkPlayer.java View File

@@ -1,5 +1,5 @@
1 1
 /*
2
- * Copyright (c) Chris 'MD87' Smith, 2007. All rights reserved.
2
+ * Copyright (c) Chris 'MD87' Smith, 2007-2008. All rights reserved.
3 3
  *
4 4
  * This code may not be redistributed without prior permission from the
5 5
  * aforementioned copyright holder(s).
@@ -31,128 +31,153 @@ public class NetworkPlayer implements PlayerController, GameObserver {
31 31
     }
32 32
 
33 33
     /** {@inheritDoc} */
34
+    @Override
34 35
     public CallRaiseFold doCallRaiseFold(int callAmount, boolean canRaise) {
35 36
         return CallRaiseFold.CALL;
36 37
         // Do nothing
37 38
     }
38 39
 
39 40
     /** {@inheritDoc} */
41
+    @Override
40 42
     public OpenCheck doOpenCheck() {
41 43
         return OpenCheck.CHECK;
42 44
         // Do nothing
43 45
     }
44 46
 
45 47
     /** {@inheritDoc} */
48
+    @Override
46 49
     public boolean shouldShowCards() {
47 50
         return false;
48 51
         // Do nothing
49 52
     }
50 53
 
51 54
     /** {@inheritDoc} */
55
+    @Override
52 56
     public void setPlayer(Player player) {
53 57
         // Do nothing
54 58
     }
55 59
 
56 60
     /** {@inheritDoc} */
61
+    @Override
57 62
     public void setGame(Game game) {
58 63
         game.registerObserver(this);
59 64
     }
60 65
 
61 66
     /** {@inheritDoc} */
67
+    @Override
62 68
     public int getRaise(int minimum) {
63 69
         return minimum;
64 70
         // Do nothing
65 71
     }
66 72
 
67 73
     /** {@inheritDoc} */
74
+    @Override
68 75
     public void communityCardsUpdated() {
69 76
         // Do nothing
70 77
     }
71 78
 
72 79
     /** {@inheritDoc} */
80
+    @Override
73 81
     public void playerCardsUpdated() {
74 82
         // Do nothing
75 83
     }
76 84
 
77 85
     /** {@inheritDoc} */
86
+    @Override
78 87
     public void playersTurn(Player player) {
79 88
         // Do nothing
80 89
     }
81 90
 
82 91
     /** {@inheritDoc} */
92
+    @Override
83 93
     public void newPlayer(Player player) {
84 94
         // Do nothing
85 95
     }
86 96
 
87 97
     /** {@inheritDoc} */
98
+    @Override
88 99
     public void newGame() {
89 100
         // Do nothing
90 101
     }
91 102
 
92 103
     /** {@inheritDoc} */
104
+    @Override
93 105
     public void endGame() {
94 106
         // Do nothing
95 107
     }
96 108
 
97 109
     /** {@inheritDoc} */
110
+    @Override
98 111
     public void setDealer(Player player) {
99 112
         // Do nothing
100 113
     }
101 114
 
102 115
     /** {@inheritDoc} */
116
+    @Override
103 117
     public void placeBlind(Player player, int blind, String name) {
104 118
         // Do nothing
105 119
     }
106 120
 
107 121
     /** {@inheritDoc} */
122
+    @Override
108 123
     public void raise(Player player, int amount) {
109 124
         // Do nothing
110 125
     }
111 126
 
112 127
     /** {@inheritDoc} */
128
+    @Override
113 129
     public void fold(Player player) {
114 130
         // Do nothing
115 131
     }
116 132
 
117 133
     /** {@inheritDoc} */
134
+    @Override
118 135
     public void call(Player player) {
119 136
         // Do nothing
120 137
     }
121 138
 
122 139
     /** {@inheritDoc} */
140
+    @Override
123 141
     public void check(Player player) {
124 142
         // Do nothing
125 143
     }
126 144
 
127 145
     /** {@inheritDoc} */
146
+    @Override
128 147
     public void open(Player player, int amount) {
129 148
         // Do nothing
130 149
     }
131 150
 
132 151
     /** {@inheritDoc} */
152
+    @Override
133 153
     public void winner(Player players) {
134 154
         // Do nothing
135 155
     }
136 156
 
137 157
     /** {@inheritDoc} */
158
+    @Override
138 159
     public void showdown() {
139 160
         // Do nothing
140 161
     }
141 162
 
142 163
     /** {@inheritDoc} */
164
+    @Override
143 165
     public boolean isLocalHuman() {
144 166
         return false;
145 167
     }
146 168
     
147 169
     /** {@inheritDoc} */
170
+    @Override
148 171
     public Deck discardCards(final int minimum, final int maximum) {
149 172
         return new Deck();
150 173
     }
151 174
 
175
+    @Override
152 176
     public void discards(Player player, int number) {
153 177
         // Do nothing
154 178
     }
155 179
 
180
+    @Override
156 181
     public void cardDealt(Player player, Card card) {
157 182
         // Do nothing
158 183
     }

+ 35
- 2
src/com/md87/cardgame/interfaces/GameObserver.java View File

@@ -1,5 +1,5 @@
1 1
 /*
2
- * Copyright (c) Chris 'MD87' Smith, 2007. All rights reserved.
2
+ * Copyright (c) Chris 'MD87' Smith, 2007-2008. All rights reserved.
3 3
  *
4 4
  * This code may not be redistributed without prior permission from the
5 5
  * aforementioned copyright holder(s).
@@ -11,23 +11,56 @@ import com.md87.cardgame.Card;
11 11
 import com.md87.cardgame.Player;
12 12
 
13 13
 /**
14
- *
14
+ * The main interface for objects that wish to observe game events as they
15
+ * happen.
16
+ * 
15 17
  * @author Chris
16 18
  */
17 19
 public interface GameObserver {
18 20
 
21
+    /**
22
+     * Called when the community cards have been updated.
23
+     */
19 24
     void communityCardsUpdated();
20 25
     
26
+    /**
27
+     * Called when the players' hole cards have been updated.
28
+     * 
29
+     * @deprecated Behaviour should be done in cardDealt instead
30
+     */
31
+    @Deprecated
21 32
     void playerCardsUpdated();
22 33
     
34
+    /**
35
+     * Called when a card is dealt to the specified player.
36
+     * 
37
+     * @param player The player the card is being dealt to
38
+     * @param card The card that was dealt
39
+     */
23 40
     void cardDealt(final Player player, final Card card);
24 41
     
42
+    /**
43
+     * Called at the start of a player's turn.
44
+     * 
45
+     * @param player The player whose turn it is now
46
+     */
25 47
     void playersTurn(final Player player);
26 48
     
49
+    /**
50
+     * Called when a new player enters the game.
51
+     * 
52
+     * @param player The player that has joined
53
+     */
27 54
     void newPlayer(final Player player);
28 55
     
56
+    /**
57
+     * Called at the start of a game.
58
+     */
29 59
     void newGame();
30 60
     
61
+    /**
62
+     * Called at the end of a game.
63
+     */
31 64
     void endGame();
32 65
     
33 66
     void setDealer(final Player player);

Loading…
Cancel
Save