/**********************************************************************
 *
 *   FreeDoko a Doppelkopf-Game
 *
 *   Copyright (C) 2001-2004  by Diether Knof and Borg Enders
 *
 *   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 can find this license in the file 'gpl.txt'.
 *
 *   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
 *
 *  Contact:
 *    Diether Knof dknof@gmx.de
 *    Borg Enders  borg@borgsoft.de
 *
 *********************************************************************/

#include "constants.h"

#include "ui.wrap.h"

#include "../card/hand.h"

/**
 **
 ** Constructor
 ** a ui of the type 'DUMMY' and no os
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
UI_Wrap::UI_Wrap() :
UI(UI_TYPE::WRAP),
  ui(new_UI(UI_TYPE::DUMMY)),
os()
{
  return ;
} // UI_Wrap::UI_Wrap()

/**
 **
 ** Destructor
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
UI_Wrap::~UI_Wrap()
{
  return ;
} // UI_Wrap::~UI_Wrap()

/**
 **
 ** Function for the initialisation of the UI.
 **
 ** @param	argc	number of arguments
 ** @param	argv	arguments
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::init(int& argc, char**& argv)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->init(argc, argv);

  this->ui->init(argc, argv);

  return ;
} // UI_Wrap::init(argc, argv)

/**
 **
 ** updates the UI
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::update()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->update();

  this->ui->update();

  return ;
} // void UI_Wrap::update()

/**
 **
 ** sleeps the given time
 ** (in miliseconds, UINT_MAX for infinity)
 **
 ** @param	sleep_usec	time to sleep
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::sleep(unsigned const sleep_usec)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->sleep(sleep_usec);

  this->ui->sleep(sleep_usec);

  return ;
} // void UI_Wrap::sleep(unsigned const sleep_usec)

/**
 **
 ** all language elements of the UI shall be updated
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::language_update()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->language_update();

  this->ui->language_update();

  return ;
} // void UI_Wrap::language_update()

/**
 **
 ** the party is opened
 **
 ** @param	party	party that is opened
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_open(Party& party)
{
  this->UI::party_open(party);

  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_open(party);

  this->ui->party_open(party);

  return ;
} // void UI_Wrap::party_open(Party& party)

/**
 **
 ** gets and sets the settings of the party
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_get_settings()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_get_settings();

  this->ui->party_get_settings();

  return ;
} // void UI_Wrap::party_get_Settings()

/**
 **
 ** start of the party
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_start()
{ 
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_start();

  this->ui->party_start();

  return ;
} // void UI_Wrap::party_start()

/**
 **
 ** a new round is started
 **
 ** @param	round	round that is started
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_start_round(unsigned const round)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_start_round(round);

  this->ui->party_start_round(round);
}

/**
 **
 ** end of the party
 ** (p.e. to show the points and the winner)
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_finish()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_finish();

  this->ui->party_finish();

  return ;
} // void UI_Wrap::party_end()

/**
 **
 ** the party will close
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::party_close()
{
  this->UI::party_close();

  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->party_close();

  this->ui->party_close();

  return ;
} // void UI_Wrap::party_close()

/**
 **
 ** a game is opened
 **
 ** @param	game	game that is opened
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::game_open(Game& game)
{
  this->UI::game_open(game);

  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->game_open(game);

  this->ui->game_open(game);

  return ;
} // void UI_Wrap::game_open(Game& game)

/**
 **
 ** the game is redistributed
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7b
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::game_redistribute()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->game_redistribute();

  this->ui->game_redistribute();

  return ;
} // void UI_Wrap::game_redistribute()

/**
 **
 ** gets the reservations of the player 'player'
 ** Here is the first time, the hands can be shown (and should)
 **
 ** @param	player	the player that makes the reservation
 **
 ** @return	Reservation of the player 'player'
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
Reservation
UI_Wrap::reservation_get(Player const& player)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->reservation_get(player);

  return this->ui->reservation_get(player);
} // Reservation UI_Wrap::reservation_get(player)

/**
 **
 ** the game is started
 ** (p.e. show the announcements of the other players)
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::game_start()
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->game_start();

  this->ui->game_start();

  return ;
} // void UI_Wrap::game_start()

/**
 **
 ** the game is finished
 ** (p.e. show the winner and the points of the game)
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::game_finish()
{ 
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->game_finish();

  this->ui->game_finish();

  return ;
} // void UI_Wrap::game_finish()

/**
 **
 ** the game will close
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::game_close()
{
  this->UI::game_close();

  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->game_close();

  this->ui->game_close();

  return ;
} // void UI_Wrap::game_close()

/**
 **
 ** a new trick is opened
 **
 ** @param	trick	trick that is opened
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::trick_open(Trick const& trick)
{
  this->UI::trick_open(trick);

  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->trick_open(trick);

  this->ui->trick_open(trick);

  return ;
} // void UI_Wrap::trick_open(Trick const& trick)

/**
 **
 ** gets the card, the player wishes to play
 ** (don't remove it from the hand!)
 **
 ** @param	player	the player who shall play a card
 **
 ** @return	Card to be played
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
Card
UI_Wrap::card_get(Player const& player)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->card_get(player);

  return this->ui->card_get(player);
} // Card UI_Wrap::card_get(Player const& player)

/**
 **
 ** the player 'player' plays the card 'card'
 **
 ** @param	card  	the played card
 ** @param	player	the player, who has played a card
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::card_played(Card const& card, Player const& player)
{ 
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->card_played(card, player);

  this->ui->card_played(card, player);

  return ;
} // void UI_Wrap::card_played(Card const& card, Player const& player)

/**
 **
 ** the announcement 'announcement' has been made by player 'player'
 **
 ** @param	announcement	the announcement
 ** @param	player		the player, who has made the announcement
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::announcement_made(Announcement const& announcement,
			   Player const& player)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->announcement_made(announcement, player);

  this->ui->announcement_made(announcement, player);

  return ;
} // void UI_Wrap::announcement_made(Announcement const& announcement, Player const& player)

/**
 **
 ** the player has swines
 **
 ** @param	player		the player with the swines
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::swines_announced(Player const& player)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->swines_announced(player);

  this->ui->swines_announced(player);

  return ;
} // void UI_Wrap::swines_announced(Player const& player)

/**
 **
 ** the player has hyperswines
 **
 ** @param	player		the player with the swines
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::hyperswines_announced(Player const& player)
{
  vector<OS*> oss = this->os;
  
  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->hyperswines_announced(player);

  this->ui->hyperswines_announced(player);

  return ;
} // void UI_Wrap::hyperswines_announced(Player const& player)

/**
 **
 ** 'player' has a poverty and shifts cards
 **
 ** @param	player	the player who has the poverty
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_shifting(Player const& player)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_shifting(player);

  this->ui->poverty_shifting(player);

  return ;
} // void UI_Wrap::poverty_shifting(Player const& player)

/**
 **
 ** 'player' shifts 'cardno' cards
 **
 ** @param	player	the player who shifts the cards
 ** @param	cardno	the number of cards that are shifted
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_shift(Player const& player, unsigned const cardno)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_shift(player, cardno);

  this->ui->poverty_shift(player, cardno);

  return ;
} // void UI_Wrap::poverty_shift(Player const& player, unsigned const cardno)

/**
 **
 ** ask 'player' whether to accept the poverty
 **
 ** @param	player	the player who is asked
 ** @param	cardno	number of cards that are given back
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_ask(Player const& player, unsigned const cardno)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_ask(player, cardno);

  this->ui->poverty_ask(player, cardno);

  return ;
} // void UI_Wrap::poverty_ask(Player const& player, unsigned const cardno)

/**
 **
 ** 'player' denied to take the shifted cards
 **
 ** @param	player	the player who has denied to take the cards
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_take_denied(Player const& player)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_take_denied(player);

  this->ui->poverty_take_denied(player);

  return ;
} // void UI_Wrap::poverty_take_denied(Player const& player)

/**
 **
 ** all players have denied to take the cards
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_take_denied_by_all()
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_take_denied_by_all();

  this->ui->poverty_take_denied_by_all();

  return ;
} // void UI_Wrap::poverty_take_denied_by_all()

/**
 **
 ** 'player' accepts to take the shifted cards
 ** and returns 'cardno' cards with 'trumpno' trumps
 **
 ** @param	player	the player who has denied to take the cards
 ** @param	cardno	number of cards that are given back
 ** @param	trumpno	number of trumps of the cards
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_take_accepted(Player const& player,
			       unsigned const cardno, unsigned const trumpno)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_take_accepted(player, cardno, trumpno);

  this->ui->poverty_take_accepted(player, cardno, trumpno);

  return ;
} // void UI_Wrap::poverty_take_accepted(Player const& player, unsigned const cardno, unsigned const trumpno)

/**
 **
 ** returns which cards the player shifts
 **
 ** @param	player	the player who shifts the cards
 **
 ** @return	the cards that are to be shifted
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
Hand
UI_Wrap::poverty_shift(Player& player)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_shift(player);

  return this->ui->poverty_shift(player);
} // void UI_Wrap::poverty_shift(Player const& player)

/**
 **
 ** returns whether 'player' accepts the shifted cards
 **
 ** @param	player	the player who shifts the cards
 ** @param	cardno	the number of shifted cards
 **
 ** @return	whether to accept the cards
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
bool
UI_Wrap::poverty_take_accept(Player& player, unsigned const cardno)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_take_accept(player, cardno);

  return this->ui->poverty_take_accept(player, cardno);
} // void UI_Wrap::poverty_take_accept(Player const& player, unsigned const cardno)

/**
 **
 ** changes the cards from the poverty-player
 **
 ** @param	player	the player who has accepted the cards
 ** @param	cards	the cards that are given to the player
 **
 ** @return	the cards that are returned to the poverty-player
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
Hand
UI_Wrap::poverty_cards_change(Player& player, Hand const& cards)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_cards_change(player, cards);

  return this->ui->poverty_cards_change(player, cards);
} // Hand UI_Wrap::poverty_cards_change(Player& player, Hand const& cards)

/**
 **
 ** the poverty player 'player' gets 'cards'
 **
 ** @param	player	the player gets the cards
 ** @param	cards	the cards that are given to the player
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::poverty_cards_get_back(Player& player, Hand const& cards)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->poverty_cards_get_back(player, cards);

  return this->ui->poverty_cards_get_back(player, cards);
} // void UI_Wrap::poverty_cards_get_back(Player& player, Hand const& cards)

/**
 **
 ** marriage: Information of the new team
 **
 ** @param	bridegroom	the player with the marriage
 ** @param	bride		the bride
 **
 ** @return	-
 **
 ** @author	Diether Knof
 **
 ** @version	0.6.7
 **
 **/
void
UI_Wrap::marriage(Player const& bridegroom,
	     Player const& bride)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->marriage(bridegroom, bride);

  this->ui->marriage(bridegroom, bride);

  return ;
} // void UI_Wrap::marriage(Player const& bridegroom, Player const& bride)

/**
 **
 ** genscher: -> result
 **
 ** @param	-
 **
 ** @return	pointer to the new teammate,
 **		NULL if the genscher is not to be announced
 **
 ** @author	Diether Knof
 **
 ** @version	0.6.7
 **
 **/
Player const*
UI_Wrap::genscher_partner()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->genscher_partner();

  return this->ui->genscher_partner();
} // Player const* UI_Wrap::genscher_partner()

/**
 **
 ** genscher: Information of the new team
 **
 ** @param	player	genscher player
 ** @param	partner	partner of the gensher player
 **
 ** @return	-
 **
 ** @author	Diether Knof
 **
 ** @version	0.6.7
 **
 **/
void
UI_Wrap::genscher(Player const& player,
		  Player const& partner)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->genscher(player, partner);

  this->ui->genscher(player, partner);

  return ;
} // void UI_Wrap::genscher(Player const& player, Player const& partner)

/**
 **
 ** the trick 'trick' is full
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::trick_full()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->trick_full();

  this->ui->trick_full();

  return ;
} // void UI_Wrap::trick_full()

/**
 **
 ** moves the trick in the pile of the winnerplayer
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::trick_move_in_pile()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->trick_move_in_pile();

  this->ui->trick_move_in_pile();

  return ;
} // void UI_Wrap::trick_move_in_pile()

/**
 **
 ** the trick is closed
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::trick_close()
{
  this->UI::trick_close();

  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->trick_close();

  this->ui->trick_close();

  return ;
} // void UI_Wrap::trick_close()

/**
 **
 ** redraw all
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::redraw_all()
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->redraw_all();

  this->ui->redraw_all();

  return ;
} // void UI_Wrap::redraw_all()

/**
 **
 ** the player 'player' has to be updated
 **
 ** @param	player	the player
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::player_update(Player const& player)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->player_update(player);

  this->ui->player_update(player);

  return ;
} // void UI_Wrap::player_update(player)

/**
 **
 ** the name of the player 'player' has to be updated
 **
 ** @param	player	the player, whose name is changed
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::name_update(Player const& player)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->name_update(player);

  this->ui->name_update(player);

  return ;
} // void UI_Wrap::name_update(player)

/**
 **
 ** the hand of the player 'player' has to be updated
 **
 ** @param	player	the player, whose hand is to be updated
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::hand_update(Player const& player)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->hand_update(player);

  this->ui->hand_update(player);

  return ;
} // void UI_Wrap::hand_update(player)

/**
 **
 ** the teaminfo of the player 'player' has to be updated
 **
 ** @param	player	the player whose team should be updated
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::teaminfo_update(Player const& player)
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->teaminfo_update(player);

  this->ui->teaminfo_update(player);

  return ;
} // void UI_Wrap::team_udpate(player)

/**
 **
 ** the gametype has to be updated
 ** (take the player from 'game.soloplayer()'
 **
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::gametype_update()
{ 
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->gametype_update();

  this->ui->gametype_update();

  return ;
} // void UI_Wrap::gametype_udpate()

/**
 **
 ** the rule 'type' has changed
 **
 ** @param	type		the type that has changed
 ** @param	old_value	old value
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::rule_update(int const type, void const* const old_value)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->rule_update(type, old_value);

  this->ui->rule_update(type, old_value);

  return ;
} // void UI_Wrap::rule_update(int const type, void const* const old_value)

/**
 **
 ** the setting 'type' has changed
 **
 ** @param	type		the type that has changed
 ** @param	old_value	old value
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::setting_update(int const type, void const* const old_value)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->setting_update(type, old_value);

  this->ui->setting_update(type, old_value);

  return ;
} // void UI_Wrap::setting_update(int const type, void const* const old_value)

/**
 **
 ** load the page with the help
 **
 ** @param	page	the page to be loaded
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::help_load(string const& page)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->help_load(page);

  this->ui->help_load(page);

  return ;
}

/**
 **
 ** the status message has changed
 **
 ** @param	message	the status message
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::status_message_changed(Translator::Translation const& message)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->status_message_changed(message);

  this->ui->status_message_changed(message);

  return ;
}

/**
 **
 ** the program is busy
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::set_busy()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->set_busy();

  this->ui->set_busy();

  return ;
}

/**
 **
 ** the program is not busy any more
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::set_not_busy()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->set_not_busy();

  this->ui->set_not_busy();

  return ;
}

/**
 **
 ** the progress has changed
 **
 ** @param	progress	the progress
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::progress_changed(double const progress)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->progress_changed(progress);

  this->ui->progress_changed(progress);

  return ;
}

/**
 **
 ** the progress is finished
 **
 ** @param	-
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::progress_finished()
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->progress_finished();

  this->ui->progress_finished();

  return ;
}

/**
 **
 ** information for the user
 **
 ** @param	message		message for the user
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::information(Translator::Translation const& message)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->information(message);

  this->ui->information(message);

  return ;
}

/**
 **
 ** an error has occured
 **
 ** @param	message		message with the error description (hopefully)
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::error(string const& message)
{
  vector<OS*> oss = this->os;

  for (vector<OS*>::iterator os = oss.begin(); os != oss.end(); os++)
    (*os)->error(message);

  this->ui->error(message);

  return ;
}

/**
 **
 ** sets the ui that is wrapped
 **
 ** @param	ui	the wrapped ui
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::ui_set(UI* const ui)
{ 
  delete this->ui;
  this->ui = ui;

  return ;
} // void UI_Wrap::ui_set(UI* const ui)

/**
 **
 ** add the os to the wrapped os's
 **
 ** @param	os	os to be appended
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::append(OS* const os)
{ 
  this->os.push_back(os);

  return ;
} // void UI_Wrap::append(OS* const os)

/**
 **
 ** remove 'os' from the wrapped 'os's
 **
 ** @param	os	os to be removeed
 **
 ** @return	-
 **
 ** @version	0.6.7
 **
 ** @author	Diether Knof
 **
 **/
void
UI_Wrap::remove(OS* const os)
{ 
  for (vector<OS*>::iterator os_it = this->os.begin();
       os_it != this->os.end();
       os_it++)
    if (*os_it == os) {
      this->os.erase(os_it);
      break;
    } // if (*os_it == os) 

  return ;
} // void UI_Wrap::remove(OS* const os)
