Exemplo n.º 1
0
 // 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static void InstanceReset()
 {
     _instance = null;
 }