Created
August 31, 2012 20:50
-
-
Save codeimpossible/3558807 to your computer and use it in GitHub Desktop.
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 characters
public class WeaponBase : IWeapon | |
{ | |
private static WeaponBase _instance; | |
public static WeaponBase Instance() | |
{ | |
var lockObj = new Object(); | |
if ( _instance == null ) | |
{ | |
lock ( lockObj ) | |
{ | |
_instance = _instance ?? new WeaponBase(); | |
} | |
} | |
return _instance; | |
} | |
private WeaponBase() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment