-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.cpp
More file actions
54 lines (38 loc) · 643 Bytes
/
Game.cpp
File metadata and controls
54 lines (38 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "Game.h"
Game::Game()
{
_window = new Window(GAME_NAME);
_board = new Board();
_dice = new Dice();
_stateMachine = new GameStateMachine(_board);
}
Game::~Game()
{
delete _dice;
delete _board;
delete _stateMachine;
delete _window;
}
void Game::Initialize()
{
_board->Initialize();
_dice->Initialize();
_stateMachine->Initialize(GAME_INITIAL_STATE);
}
void Game::Update()
{
_window->Update();
Input::Update();
Mouse::Update();
_stateMachine->Update();
}
void Game::Draw()
{
_window->BeginDraw();
_stateMachine->Draw(_window);
_window->EndDraw();
}
bool Game::IsOpened()
{
return _window->IsOpen();
}