My Project
application.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "application.h"
3 #include "model\loader.h"
4 #include "scene\scene.h"
5 
7 {
8 }
9 
10 Application::Application(HWND hWnd, int x, int y, int width, int height)
11 {
12  this->scene = new Scene(hWnd, x, y, width, height);
13  if (!this->scene)
14  {
15  throw AllocationMemoryError();
16  }
17 
18  this->loadedBricks = new Composite;
19  if (!this->loadedBricks)
20  {
21  delete this->scene;
22  this->scene = nullptr;
23  throw AllocationMemoryError();
24  }
25 }
26 
28 {
29  delete this->scene;
30  delete this->loadedBricks;
31  this->scene = nullptr;
32  this->loadedBricks = nullptr;
33 }
34 
35 void Application::call(Action& act, int ID)
36 {
37  act.Execute(this->scene, this->loadedBricks, ID);
38 }
Contains loaded bricks.
Definition: composite.h:23
void call(Action &act, int id)
Definition: application.cpp:35
Definition: action.h:5
Main scene.
Definition: scene.h:29
virtual void Execute(Scene *scene, Composite *loadedBricks, int ID)=0