// Methods // Singleton public static RPS Instance(int pnum, int cnum) { if (_instance == null) { lock (syncLock) { if (_instance == null) { _instance = new RPS(pnum, cnum); } } } return(_instance); }
public GameData ChooseGame(bool newgame, string choice, int pnum, int cnum) { GameData game = null; if (choice.ToLower() == "rps") { if (newgame) { RPS.InstanceReset(); } game = RPS.Instance(pnum, cnum); } else if (choice.ToLower() == "test") { Console.WriteLine("ステージ1:テスト成功"); if (newgame) { test.InstanceReset(); } game = test.Instance(pnum, cnum); } return(game); }
public static void InstanceReset() { _instance = null; }