Beispiel #1
0
        public static MemoryGame getSingleton(String username, UserSelect u)
        {
            if (instance == null)
            {
                instance = new MemoryGame(username, u);
            }
            else
            {
                if (instance.hsTable.ContainsKey(username))
                {
                    instance.hsTable[username] = 0;
                }
                else
                {
                    instance.hsTable.Add(username, 0);
                }

                instance.username       = username;
                instance.score          = 0;
                instance.lbl_score.Text = "0";
                instance.startOver(null, null);
            }

            return(instance);
        }
Beispiel #2
0
 private MemoryGame(String username, UserSelect u)
 {
     this.userMenu = u;
     u.Hide();
     this.username = username;
     this.score    = 0;
     pairPlay.Add(0);
     pairPlay.Add(1);
     this.hsTable.Add(username, 0);
     InitializeComponent();
 }