Exemplo n.º 1
0
        public MemoModel()
        {
            model = new List <MemoTile>(memoSize);
            List <MemoTileType> typeList = new List <MemoTileType>(memoSize);

            for (int i = 0; i < memoSize / 2; i++)
            {
                typeList.Add((MemoTileType)i);
            }

            for (int i = 0; i < memoSize / 2; i++)
            {
                typeList.Add((MemoTileType)i);
            }


            for (int i = 0; i < memoSize; i++)
            {
                MemoTileType type = typeList[rand.Next(typeList.Count())];
                typeList.Remove(type);
                model.Add(new MemoTile(type));
            }

            showned = 0;
        }
 public MemoTile(MemoTileType type)
 {
     visible   = false;
     matched   = false;
     this.type = type;
 }
 public MemoTile(MemoTileType type)
 {
     visible = false;
     matched = false;
     this.type = type;
 }