// 한 줄이 다 채워지면 라인을 없앤다.
        public void DestroyCheck()
        {
            for (int y = BlockList.Count - 1; y >= 0; y--)
            {
                bool IsDestroy = true;
                for (int x = 0; x < BlockList[y].Count; x++)
                {
                    // 만약 한 라인에 공백이 있다면 부술 필요가 없다.
                    if (BlockList[y][x] == "□")
                    {
                        IsDestroy = false;
                    }
                }

                // 만약 부술 라인이 있다면
                if (IsDestroy)
                {
                    // 새로운 라인을 생성한다.
                    List <string> newLine = new List <string>();

                    // 공백을 넣는다.
                    for (int i = 0; i < X; i++)
                    {
                        newLine.Add("□");
                    }

                    // 맨 뒤를 날리고 다시 넣는다.
                    BlockList.RemoveAt(BlockList.Count - 1);
                    BlockList.Insert(0, newLine);

                    // 내려 앉았으니 다시 검색한다.
                    y = BlockList.Count - 1;
                }
            }
        }
Example #2
0
        private void DeleteBlock()
        {
            //Remove
            TagField.BlockList.RemoveAt(selectedBlockIndex);
            BlockList.RemoveAt(selectedBlockIndex);

            //Notify Changes
            NotifyPropertyChanged(nameof(HasBlocks));

            //Set
            SelectedBlockIndex = selectedBlockIndex - 1;
            NotifyValueChanged();
        }