diff --git a/lesson#24 - Observer Design Pattern/ourGame/.gitignore b/lesson#24 - Observer Design Pattern/ourGame/.gitignore deleted file mode 100644 index b2c8b49..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -.dub -docs.json -__dummy.html -docs/ -/ourgame -ourgame.so -ourgame.dylib -ourgame.dll -ourgame.a -ourgame.lib -ourgame-test-* -*.exe -*.o -*.obj -*.lst diff --git a/lesson#24 - Observer Design Pattern/ourGame/dub.json b/lesson#24 - Observer Design Pattern/ourGame/dub.json deleted file mode 100644 index fb77399..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/dub.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "authors": [ - "rillk500" - ], - "copyright": "no copyright", - "dependencies": { - "raylib-d": "~>3.0.3" - }, - "description": "2D game", - "libs": [ - "raylib" - ], - "license": "no license", - "name": "ourgame" -} diff --git a/lesson#24 - Observer Design Pattern/ourGame/dub.selections.json b/lesson#24 - Observer Design Pattern/ourGame/dub.selections.json deleted file mode 100644 index 6c4a00d..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/dub.selections.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "fileVersion": 1, - "versions": { - "ddmp": "0.0.1-0.dev.3", - "fluent-asserts": "0.13.3", - "libdparse": "0.14.0", - "raylib-d": "3.0.3", - "stdx-allocator": "2.77.5" - } -} diff --git a/lesson#24 - Observer Design Pattern/ourGame/source/app.d b/lesson#24 - Observer Design Pattern/ourGame/source/app.d deleted file mode 100644 index d917685..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/source/app.d +++ /dev/null @@ -1,44 +0,0 @@ -import data; -import gstatemanager; - -import menu; -import play; - -void main() { - /*// init - InitWindow(windowWidth, windowHeight, "Mission X"); - scope(exit) CloseWindow(); - - // set frames per second - SetTargetFPS(60); - - while(!WindowShouldClose()) { - // process events - - // update - // calling the dummy function - GStateManager.getInstance().hello_world(); - - // render - BeginDrawing(); - scope(exit) EndDrawing(); - - ClearBackground(Colors.WHITE); - // .. draw .. - }*/ -} - - - - - - - - - - - - - - - diff --git a/lesson#24 - Observer Design Pattern/ourGame/source/data.d b/lesson#24 - Observer Design Pattern/ourGame/source/data.d deleted file mode 100644 index 031a1a6..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/source/data.d +++ /dev/null @@ -1,15 +0,0 @@ -module data; - -// mostly used libraries -public import raylib; -public import std.stdio: writeln, write; - -// window dimensions -immutable windowWidth = 720; -immutable windowHeight = 640; - -// state interface -interface IState { - void run(); -} - diff --git a/lesson#24 - Observer Design Pattern/ourGame/source/gstatemanager.d b/lesson#24 - Observer Design Pattern/ourGame/source/gstatemanager.d deleted file mode 100644 index a83a6ae..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/source/gstatemanager.d +++ /dev/null @@ -1,47 +0,0 @@ -import data; - -class GStateManager { - // private class instance - private static GStateManager instance; - - // IState interface - private IState state; - - // private constructor - private this() { } - - // return the instance; create the instance, if it wasn't created yet - static GStateManager getInstance() { - if(instance is null) { - instance = new GStateManager(); - } - - return instance; - } - - // set game state - void setState(IState state) { - this.state = state; - } - - // execute the current game state code - void execute() { - if(state is null) { - return; - } - - state.run(); - } -} - - - - - - - - - - - - diff --git a/lesson#24 - Observer Design Pattern/ourGame/source/menu.d b/lesson#24 - Observer Design Pattern/ourGame/source/menu.d deleted file mode 100644 index 3484d62..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/source/menu.d +++ /dev/null @@ -1,12 +0,0 @@ -module menu; - -import data; - -class Menu: IState { - this() {} - - // inherited from IState interface - void run() { - writeln("*** menu state ***"); - } -} \ No newline at end of file diff --git a/lesson#24 - Observer Design Pattern/ourGame/source/play.d b/lesson#24 - Observer Design Pattern/ourGame/source/play.d deleted file mode 100644 index 054cb02..0000000 --- a/lesson#24 - Observer Design Pattern/ourGame/source/play.d +++ /dev/null @@ -1,12 +0,0 @@ -module play; - -import data; - -class Play: IState { - this() {} - - // inherited from IState interface - void run() { - writeln("*** play state ***"); - } -} \ No newline at end of file diff --git a/lesson#24 - Observer Design Pattern/slides/ObserverDiagram2.png b/lesson#24 - Observer Design Pattern/slides/ObserverDiagram2.png new file mode 100644 index 0000000..129fb56 Binary files /dev/null and b/lesson#24 - Observer Design Pattern/slides/ObserverDiagram2.png differ diff --git a/lesson#24 - Observer Design Pattern/slides/ObserverExample.png b/lesson#24 - Observer Design Pattern/slides/ObserverExample.png new file mode 100644 index 0000000..fe44a43 Binary files /dev/null and b/lesson#24 - Observer Design Pattern/slides/ObserverExample.png differ diff --git a/lesson#24 - Observer Design Pattern/slides/observer.jpg b/lesson#24 - Observer Design Pattern/slides/observer.jpg new file mode 100644 index 0000000..7c9051f Binary files /dev/null and b/lesson#24 - Observer Design Pattern/slides/observer.jpg differ