/* This file is part of cardwords
   (c) 1999 Tobias Peters
   see file COPYING for the copyright terms.
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// cardwords_clientpile.hh

#ifndef CARDWORDS_CLIENTPILE_HH
#define CARDWORDS_CLIENTPILE_HH

// CardWords_ClientPile the same as CardWords_Pile with one additional
// feature:
// It has a memberfunction get_remaining_cards_count() which returns the
// number of cards in the pile on the server side.
// While the pile in the server programm always returns the right number of
// remaining cards when asked for occupied_places(), this is not true for
// the pile on the client side, because the client programm does not
// necessarily know how many cards are on the handes of the other players. The
// server tells the client about that number and the client programm (namely
// the commclient object) stores this number additionally in the
// CardWords_ClientPile object.

#include "cardwords_pile.hh"

class CardWords_ClientPile : public CardWords_Pile {
private:
  size_t remaining_cards;

public:
  virtual size_t get_remaining_cards(void) const {
    return remaining_cards;
  }

  void set_remaining_cards(size_t remaining_count) {
    remaining_cards = remaining_count;
  }

  CardWords_ClientPile (istream &istr)
    : CardWords_Pile     (istr)
    {
      set_remaining_cards(get_cardCount());
    }
};

#endif // CARDWORDS_CLIENTPILE_HH
