-
-
Save loivis/c7e17f9ed5928f346770863fde1eacdc to your computer and use it in GitHub Desktop.
Revisions
-
theburningmonk renamed this gist
Sep 2, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
theburningmonk revised this gist
Sep 1, 2013 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,10 @@ class MyClass { } ... // rest of the class } // consuming code MyClass myObj = new MyClass(); // get back the singleton ... // another piece of consuming code MyClass myObj = new MyClass(); // still getting back the singleton -
theburningmonk revised this gist
Aug 31, 2013 . 1 changed file with 5 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,12 @@ class MyClass { static final MyClass _singleton = new MyClass._internal(); factory MyClass() { return _singleton; } MyClass._internal() { ... // initialization logic here } ... // rest of the class -
theburningmonk revised this gist
Aug 31, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ class DialogWindow extends Sprite { ResourceManager _resourceManager; static DialogWindow Singleton; // factory constructor to ensure that there is always only one instance of DialogWindow factory DialogWindow(resourceManager) { return Singleton != null ? Singleton : new DialogWindow._internal(resourceManager); } DialogWindow._internal(this._resourceManager) { ... // initialization logic here Singleton = this; } ... // rest of the class -
theburningmonk created this gist
Aug 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ class DialogWindow extends Sprite { ResourceManager _resourceManager; static DialogWindow Instance; // factory constructor to ensure that there is always only one instance of DialogWindow factory DialogWindow(resourceManager) { return Instance != null ? Instance : new DialogWindow._internal(resourceManager); } DialogWindow._internal(this._resourceManager) { ... // initialization logic here Instance = this; } ... // rest of the class }