123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- /*
- * Copyright (c) Chris 'MD87' Smith, 2007. All rights reserved.
- *
- * This code may not be redistributed without prior permission from the
- * aforementioned copyright holder(s).
- */
-
- package com.md87.cardgame.controllers;
-
- import com.md87.cardgame.Card;
- import com.md87.cardgame.Deck;
- import com.md87.cardgame.interfaces.GameObserver;
- import com.md87.cardgame.Player;
- import com.md87.cardgame.Player.CallRaiseFold;
- import com.md87.cardgame.Player.OpenCheck;
- import com.md87.cardgame.interfaces.Game;
- import com.md87.cardgame.interfaces.PlayerController;
-
- /**
- * Provides the server-side interface for network games. Each network player
- * listens on its own port, waiting for connections to come in.
- *
- * @author Chris
- */
- public class NetworkPlayer implements PlayerController, GameObserver {
-
- /**
- * Creates a new instance of NetworkPlayer.
- */
- public NetworkPlayer() {
- }
-
- /** {@inheritDoc} */
- public CallRaiseFold doCallRaiseFold(int callAmount, boolean canRaise) {
- return CallRaiseFold.CALL;
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public OpenCheck doOpenCheck() {
- return OpenCheck.CHECK;
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public boolean shouldShowCards() {
- return false;
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void setPlayer(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void setGame(Game game) {
- game.registerObserver(this);
- }
-
- /** {@inheritDoc} */
- public int getRaise(int minimum) {
- return minimum;
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void communityCardsUpdated() {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void playerCardsUpdated() {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void playersTurn(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void newPlayer(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void newGame() {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void endGame() {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void setDealer(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void placeBlind(Player player, int blind, String name) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void raise(Player player, int amount) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void fold(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void call(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void check(Player player) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void open(Player player, int amount) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void winner(Player players) {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public void showdown() {
- // Do nothing
- }
-
- /** {@inheritDoc} */
- public boolean isLocalHuman() {
- return false;
- }
-
- /** {@inheritDoc} */
- public Deck discardCards(final int minimum, final int maximum) {
- return new Deck();
- }
-
- public void discards(Player player, int number) {
- // Do nothing
- }
-
- public void cardDealt(Player player, Card card) {
- // Do nothing
- }
-
- }
|