Skip to content

Instantly share code, notes, and snippets.

@codeimpossible
Created August 31, 2012 20:50
Show Gist options
  • Save codeimpossible/3558807 to your computer and use it in GitHub Desktop.
Save codeimpossible/3558807 to your computer and use it in GitHub Desktop.
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