Esempio n. 1
0
        public int isFullRow(B1ts B1t)
        {
            int Score = 0;

            if (this.rowTracker[B1t.PosY].Contains('0') ||
                this.rowTracker[B1t.PosY].Contains(' '))
            {
                return(0);
            }

            //get the score
            Score = this.scoreTracker[B1t.PosY] * 2;
            //shift Rows down
            for (int row = B1t.PosY; row > 0; row--)
            {
                this.rowTracker[row]   = this.rowTracker[row - 1];
                this.scoreTracker[row] = this.scoreTracker[row - 1];
            }
            //reset row 0
            this.scoreTracker[0] = 0;
            this.rowTracker[0]   = this.rowTracker[0].Replace('0', ' ');
            this.rowTracker[0]   = this.rowTracker[0].Replace('1', ' ');

            return(Score);
        }
Esempio n. 2
0
        public void UpdateRow(B1ts B1t)
        {
            //get the string to combine
            string toCheck = this.rowTracker[B1t.PosY].Substring(B1t.firstX, B1t.toPrint.Length);

            toCheck = toCheck.Replace(' ', '0');
            int Check = Convert.ToInt32(toCheck, 2);

            //combine
            Check   = Check | B1t.intValue;
            toCheck = Convert.ToString(Check, 2);
            //insert new string
            this.rowTracker[B1t.PosY] = this.rowTracker[B1t.PosY].Insert(B1t.firstX, toCheck);
            this.rowTracker[B1t.PosY] = this.rowTracker[B1t.PosY].Remove(B1t.lastX + 1, toCheck.Length);
        }
Esempio n. 3
0
 //if b1t is green
 public void isGreen(B1ts B1t)
 {
     if (B1t.PosY + 1 < this.rowTracker.Count)
     {
         //get the string to combine on next row
         string toCheck = this.rowTracker[B1t.PosY + 1].Substring(B1t.firstX, B1t.toPrint.Length);
         toCheck = toCheck.Replace(' ', '0');
         int Check = Convert.ToInt32(toCheck, 2);
         //combine
         Check   = Check | B1t.intValue;
         toCheck = Convert.ToString(Check, 2);
         //insert new string
         this.rowTracker[B1t.PosY + 1] = this.rowTracker[B1t.PosY + 1].Insert(B1t.firstX, toCheck);
         this.rowTracker[B1t.PosY + 1] = this.rowTracker[B1t.PosY + 1].Remove(B1t.lastX + 1, toCheck.Length);
     }
 }
Esempio n. 4
0
        //If b1t is red
        public int isRed(B1ts B1t)
        {
            int Score = 0;

            //step 1: get score
            Score = this.scoreTracker[B1t.PosY];
            //step 2: delete row
            //shift Rows down
            for (int row = B1t.PosY; row > 0; row--)
            {
                this.rowTracker[row]   = this.rowTracker[row - 1];
                this.scoreTracker[row] = this.scoreTracker[row - 1];
            }
            //reset row 0
            this.scoreTracker[0] = 0;
            this.rowTracker[0]   = this.rowTracker[0].Replace('0', ' ');
            this.rowTracker[0]   = this.rowTracker[0].Replace('1', ' ');

            return(Score);
        }