Package cs171a2
Interface Table<T extends Card,E extends GeneralPlayer>
- Type Parameters:
T
- the type of cards that can be added to the table.E
- the type of players that can occupy places on the table.
- All Known Implementing Classes:
CardTable
public interface Table<T extends Card,E extends GeneralPlayer>
An interface representing a table where cards are played and players can
occupy places.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The number of places on the table that players can put their cards. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCardToPlace
(T card) Adds a card to the table at the first available place.void
checkPlaces
(E player) Checks the places on the table to see if any player occupies a place and removes any cards that they played.int[]
Returns the identifiers of the cards on places 1, 2, 3, and 4 on the table (in that same order).
-
Field Details
-
NUMBER_OF_PLACES
static final int NUMBER_OF_PLACESThe number of places on the table that players can put their cards.- See Also:
-
-
Method Details
-
addCardToPlace
Adds a card to the table at the first available place.- Parameters:
card
- the card to add to the table.
-
getPlaces
int[] getPlaces()Returns the identifiers of the cards on places 1, 2, 3, and 4 on the table (in that same order).- Returns:
- an array of integers representing the identifiers of all cards placed on the table
-
checkPlaces
Checks the places on the table to see if any player occupies a place and removes any cards that they played.- Parameters:
player
- the player to check for occupying a place.
-