using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FLocal.Core { class Config where T : Config { private static Config _instance; public static Config instance { get { if(_instance == null) throw new FLocalException("not initialized"); return _instance; } private set { lock(_instance) { if(_instance != null) throw new FLocalException("already initialized"); _instance = value; } } } private Config() { } public static void doInit(Config config) { _instance = config; } } }