home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 17
/
Freelog017.iso
/
BeOS
/
ababelone
/
Sources
/
PlateauDeJeuInterne.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-11-21
|
3KB
|
83 lines
/*
Copyright (C) 2000 by Hervé PHILIPPE <rv@bemail.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _PLATEAUDEJEUINTERNE_H_
#define _PLATEAUDEJEUINTERNE_H_
#include <SupportDefs.h>
#include "Coordonnees.h"
#include "PlateauDeJeu.h"
// Constante pour la taille du tableau interne
// REMARQUE : le tableau interne est de dimension carrée
#define TAILLE_TABLEAU_INTERNE 11
/* REMARQUE concernant la représentation du tableau interne :
| 0 1 2 3 4 5 6 7 8 9 10
----+---------------------------------
0 |-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Directions :
1 |-1 -1 -1 -1 -1 1 2 3 4 5 -1
2 |-1 -1 -1 -1 6 7 8 9 10 11 -1 1 2
3 |-1 -1 -1 0 0 12 13 14 0 0 -1 | /
4 |-1 -1 0 0 0 0 0 0 0 0 -1 0 -- -- 3
5 |-1 0 0 0 0 0 0 0 0 0 -1 / |
6 |-1 0 0 0 0 0 0 0 0 -1 -1 5 4
7 |-1 0 0 15 16 17 0 0 -1 -1 -1
8 |-1 18 19 20 21 22 23 -1 -1 -1 -1
9 |-1 24 25 26 27 28 -1 -1 -1 -1 -1
10 |-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
*/
class PlateauDeJeuInterne : public PlateauDeJeu
{
// FONCTIONS
public:
PlateauDeJeuInterne(uint8 nombre_boules = 28, uint8 nombre_joueurs = 2);
virtual ~PlateauDeJeuInterne();
PlateauDeJeuInterne& operator=(const PlateauDeJeuInterne& ancien_plateau_interne);
int8 ValeurCaseSuivante(int8 numero_boule, int8 direction);
int8 ValeurCasePrecedente(int8 numero_boule, int8 direction);
void DeplacerBoule(int8 numero_boule, int8 direction);
Coordonnees DeplacerBoule(Coordonnees coordonnees_case, int8 direction);
Coordonnees CoordonneesBoule(int8 numero_boule);
Coordonnees CoordonneesSuivantes(Coordonnees coordonnees_case, int8 direction);
void SetCase(Coordonnees coordonnees_case, int8 donnee);
void InitialiserBoulesEjectees();
uint8 BoulesEjectees(int8 couleur);
void IncrementerBoulesEjectees(int8 couleur);
void DecrementerBoulesEjectees(int8 couleur);
void ChangerNombreBoules(uint8 nombre_boules);
uint8* TableauBoulesEjectees();
private:
int8 ValeurCase(Coordonnees coordonnees_case);
// VARIABLES ET CONSTANTES
private:
// Tableau du nombre de boules éjectées hors du plateau de jeu (par joueur)
uint8* m_TableauBoulesEjectees;
// Tableau interne qui contient les numéros des boules, les cases vides et
// les cases interdites
int8** m_Tableau;
// Tableau qui contient les coordonnées (internes) de toutes les boules
Coordonnees* m_TableauBoulesCoord;
// Tableau qui contient la définition des 6 directions (internes)
static const Coordonnees m_kTableauDirectionInterne[6];
};
#endif