[ create a new paste ] login | about

Link: http://codepad.org/gSqA2KUh    [ raw code | fork ]

hakkun - C++, pasted on Mar 6:
//GAME.HPP
#ifndef GAME_HPP_INCLUDED
#define GAME_HPP_INCLUDED
#include "menuText.hpp"

#include <SFML/Graphics.hpp>

class Game
{
private:
    sf::RenderWindow window;
    sf::Sprite sprite_circle, sprite_sharp, field[9];
    sf::Texture texture;
    sf::FloatRect boundingbox[9];
    MenuText text_actualplayer;
    //sf::Text text_actualplayer, text_player;
    sf::Font font;
    bool IsBusy[9];
    enum players { player_circle='O', player_sharp='X' };
    enum states { state_win, state_draw, state_none };
    states state;
    players InsideField[9];
    players actual_player;

public:
    //---------ENGINE----------//
    void RunEngine();
    void CreateWindow();                //  tworzy okno
    void DisplayWindow();               //  zawiera window.draw, window.display i window.clear
    void MainLoop();                    //  petla while(window.isOpen())
    void StateManager();                //  manager stanow gry
    //---------LOAD----------//
    bool LoadTexture();                 //  laduje teksture
    void LoadBoundingBox();             //  laduje bounding boxy spritow
    void LoadIsBusy();                  //  ustawia tablice typu bool na FALSE
    bool LoadFont();                    //  laduje czcionke
    void LoadText();                    //  laduje tekst
    //---------SET----------//
    void SetSprite();                   //  ustawia obszar z tekstury dla spritow
    void SetSpritePosition();           //  ustawia pozycje spritow
    //---------DRAW----------//
    void DrawField();                   //  rysuje pole gry, pod warunkiem state = state_none
    //---------CHECK----------//
    void OnClick();
    bool CheckDraw();                   //  sprawdza czy wszystkie pola sa zajete
    void CheckWinner();                 //  sprawdza ktora kombinacja wygranej pojawila sie w grze, lub czy jest remis
    void CheckActualPlayer(int);        //  sprawdza kto wygral w danej kombinacji

};
#endif // GAME_HPP_INCLUDED


Create a new paste based on this one


Comments: