home *** CD-ROM | disk | FTP | other *** search
/ Freelog 17 / Freelog017.iso / BeOS / ababelone / Sources / FenetreAbabelone.h < prev    next >
C/C++ Source or Header  |  2000-11-22  |  5KB  |  144 lines

  1. /*
  2.     Copyright (C) 2000 by Herv├⌐ PHILIPPE <rv@bemail.org>
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public
  15.     License along with this library; if not, write to the Free
  16.     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18.  
  19. #ifndef _FENETREABABELONE_H_
  20. #define _FENETREABABELONE_H_
  21.  
  22. #include <Application.h>
  23. #include <Window.h>
  24. #include <Button.h>
  25. #include <Message.h>
  26. #include <stdio.h>
  27. #include <MenuBar.h>
  28. #include <MenuItem.h>
  29. #include <Alert.h>
  30. #include <FilePanel.h>
  31. #include <File.h>
  32. #include <FindDirectory.h>
  33. #include <Path.h>
  34. #include <OS.h>
  35.  
  36. #include "PlateauDeJeuInterne.h"
  37. #include "PlateauDeJeuGraphique.h"
  38. #include "DeplacementHumain.h"
  39. #include "DeplacementOrdinateur.h"
  40. #include "FenetreChangementDePartie.h"
  41. #include "TextesDuLogiciel.h"
  42. #include "MenuDynamique.h"
  43.  
  44. // VERSION pour "aba_Be_lone"
  45. #define VERSION_ABABELONE        "aba_Be_lone v1.1"
  46.  
  47. #define REPERTOIRE_PARTIES        "Parties"
  48. #define REPERTOIRE_FICHIER_PREFERENCES    "aba_Be_lone"
  49. #define FICHIER_PREFERENCES        "settings"
  50. #define EXTENTION_FICHIER        ".aba_Be_lone"
  51. #define ENTETE_FICHIER    "aba_Be_lone.\nFichier d'une partie faite par le logiciel \"aba_Be_lone\".\n"
  52. #define POSITION_FENETRE_ABABELONE    BRect(0,20,1023,725)
  53.  
  54. #define MSG_QUITTER                        'QUIT'
  55. #define MSG_PARTIE_PAUSE                'PAUS'
  56. #define MSG_NOUVELLE_PARTIE                'NOUD'
  57. #define MSG_CHANGER_PARTIE                'NOUP'
  58. #define MSG_CHARGER                        'CHAR'
  59. #define MSG_SAUVEGARDER                    'SAUV'
  60. #define MSG_COUP_PRECEDENT                'CPRE'
  61. #define MSG_COUP_SUIVANT                'CSUI'
  62. #define MSG_COUP_SUIVANT_REALISTE        'CSUR'
  63. #define MSG_DEPLACEMENT_REALISTE        'DREA'
  64. #define MSG_A_PROPOS_DE                    'APRO'
  65. #define MSG_LANGUE                        'Z000'
  66. #define MSG_PLATEAU_DE_JEU                'Z100'
  67.  
  68. class FenetreAbabelone : public BWindow
  69. {
  70. // FONCTIONS
  71.     public:
  72.                         FenetreAbabelone();
  73.         virtual            ~FenetreAbabelone();
  74.         virtual    bool    QuitRequested();
  75.         virtual    void    FrameResized(float width, float height);
  76.         virtual    void    MessageReceived(BMessage* message);
  77.  
  78.         void            SourisBoutonGaucheAppuye(BPoint where);
  79.         void            SourisBoutonDroitAppuye();
  80.         void            SourisBoutonRelache(BPoint where);
  81.     private:
  82.         void            CreerMenu(uint8 numero_langue = 1, uint8 numero_plateau_de_jeu = 1);
  83.         void            ChangerTextes(uint8 numero_langue);
  84.         void            RemplirTableauHexagonalPositionDeDepart();
  85. static    int32            Jouer(void* ptr_objet);
  86.         void            InterromprePartie(bool tuer_thread = true, bool interrompre_temporairement = false);
  87.         void            ContinuerPartie();
  88.         void            CommencerPartie(bool commencer_du_debut, bool mise_a_jour_buffer_ecran = true);
  89. //        void            JoueurSuivantOuPrecedent(bool joueur_suivant);
  90.         void            CoupPrecedent();
  91.         void            CoupSuivant(bool faire_glisser_les_boules = false, bool mise_a_jour_buffer_ecran = true);
  92.         void            ChargerFichier(BMessage* message);
  93.         void            SauvegarderFichier(BMessage* message);
  94.         void            PreparerListeAvantDeJouer();
  95.         void            AfficherTitre(bool partie_finie);
  96.         void            APropos();
  97.  
  98. // VARIABLES ET CONSTANTES
  99.     private:
  100.         BFile*                    m_FichierPreferences;
  101.         BFilePanel*                m_ChargerFichier;
  102.         BFilePanel*                m_SauvegarderFichier;
  103.  
  104.         FenetreChangementDePartie*    m_FenetreChangementDePartie;
  105.         thread_id                m_ThreadJouer;
  106.         uint8                    m_HumainADejaJoue;
  107.  
  108.         BMenuBar*                m_MenuBar;
  109.         BMenuItem*                m_ItemTerminer;
  110.         BMenuItem*                m_ItemCoupPrecedent;
  111.         BMenuItem*                m_ItemCoupSuivant;
  112.         BMenuItem*                m_ItemCoupSuivantRealiste;
  113.         BMenuItem*                m_ItemCharger;
  114.         BMenuItem*                m_ItemSauvegarder;
  115.         BMenuItem*                m_ItemChangerJoueurs;
  116.         BMenuItem*                m_ItemDeplacementRealiste;
  117.  
  118.         PlateauDeJeuInterne*    m_PlateauInterne;    // Objet "Plateau" qui r├⌐unit les fonctions li├⌐es au plateau de jeu interne
  119.         PlateauDeJeuGraphique*    m_PlateauGraphique;
  120.  
  121.         uint8                    m_NombreJoueurs;
  122.         uint8                    m_NombreBoules;
  123.         uint8*                    m_TableauJoueurs;
  124.         Deplacement**            m_TableauDeplacementJoueurs;
  125.         uint8                    m_JoueurCourant;
  126.  
  127.         sem_id                    m_SemaphoreThread;
  128.         BMessage*                m_MessagePourFenetre;
  129.  
  130.         bool                    m_DeplacementRealiste;
  131.         bool                    m_PartieInterrompue;
  132.         bool                    m_PartieInterrompueTemporairement;
  133.         bool                    m_PartieTerminee;
  134.         bool                    m_Debut;
  135.         BList*                    m_ListeCoupsJoues;
  136.         int32                    m_NumeroCoupJoueCourant;
  137.         bool                    m_AffichageAPropos;
  138.  
  139.         TextesDuLogiciel*        m_Textes;
  140.         MenuDynamique*            m_MenuLangue;
  141.         MenuDynamique*            m_MenuPlateauDeJeu;
  142. };
  143.  
  144. #endif