/***************************************************************************
onu.h - description
-------------------
begin : Wed Jul 18 2001
copyright : (C) 2001 by Gaël de Chalendar
email : Gael.de.Chalendar@libertysurf.fr
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#define KDE_NO_COMPAT
#ifndef ONU_H
#define ONU_H
#include
#include
#include
#include "country.h"
#include "continent.h"
class Country;
/**
* Class ONU (Organisation des Nations Unies = UNO : United Nations Organization)
* is simply the list of the countries. Its implementation file contains the
* data definining each country.
*/
class ONU : public QObject
{
Q_OBJECT
public:
ONU() {};
ONU(const QString& configFileName, BackGnd* backGnd);
/**
* The OLD constructor creates each country from the constant data defined in
* the implementation file (defining points...)
*
ONU(BackGnd *backGnd);
*/
/**
* This method returns a pointer to the country that contains the point (x,y).
* f there is no country at (x,y), the functions returns 0.
*/
Country* countryAt(int x, int y);
/**
* Calls its reset method for each country
*/
void reset(void);
/**
* Return the countries list
*/
QPtrList getCountries(void);
Country* getCountryAt(unsigned int i);
/**
* Returns the nationalities list
*/
QPtrList getNationalities(void);
/** Read property of QPtrList continents. */
virtual const QPtrList getContinents();
/** Returns the list of countries neighbours of the parameter country that
* belongs to the argument player.
*/
QPtrList neighboursBelongingTo(const Country& country, const Player* player);
/** Returns the list of countries neighbours of the parameter country that
* does not belong to the argument player.
*/
QPtrList neighboursNotBelongingTo(const Country& country, const Player* player);
/** Returns the country named "name" ; 0 in case there is no such country */
Country* countryNamed(const QString& name);
/** tests the neighbouring of all countries */
void communicatesWith_test(void);
/** @return the number of countries in the world */
unsigned int getNbCountries(void) const;
private:
/**
* The list of countries
*/
QPtrVector countries;
/**
* The list of nationalities
*/
QPtrVector nationalities;
/**
* The continents of the world
*/
QPtrVector continents;
/**
* This image stores the mask that defines the countries of the world.
* The blue RGB component value of each pixel gives the index of the
* country in the countries list.
*/
QImage countriesMask;
};
#endif // ONU_H
| Generated by: gael on noirdes.limsi.u-psud.fr on Fri Jan 3 17:03:38 2003, using kdoc 2.0a53. |