all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
20
Task/Singleton/ActionScript/singleton.as
Normal file
20
Task/Singleton/ActionScript/singleton.as
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package
|
||||
{
|
||||
public class Singleton
|
||||
{
|
||||
|
||||
private static var instance:Singleton;
|
||||
|
||||
// ActionScript does not allow private or protected constructors.
|
||||
public function Singleton(enforcer:SingletonEnforcer) {
|
||||
|
||||
}
|
||||
|
||||
public static function getInstance():Singleton {
|
||||
if (instance == null) instance = new Singleton(new SingletonEnforcer());
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class SingletonEnforcer {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue