Esempio n. 1
0
 public bool checkfield(pos p)
 {
     if ((p.x < 40 && p.x >= 0) && (p.y < 10 && p.y >= 0))
     {
         return(field[p.x, p.y] != false);
     }
     return(true);
 }
Esempio n. 2
0
 public mino_stat(pos minoopos, int stat, bool spinlast = false)
 {
     this.minoopos = minoopos;
     this.stat     = stat;
     this.spinlast = spinlast;
     idx           = 0;
     spinlast      = false;
     path          = new int[32];
 }
Esempio n. 3
0
 public mino(int[,] minofield, pos[,] kicktable, int stat, pos minopos, string name)
 {
     this.minofield = (int[, ])minofield.Clone();
     this.kicktable = kicktable;
     this.minopos   = minopos.clone();
     this.name      = name;
     this.locked    = false;
     this.spinlast  = false;
     height         = minofield.GetLength(0);
     weight         = minofield.GetLength(1);
     this.stat      = stat;
     setstat(stat);
 }
Esempio n. 4
0
        //public mino_stat(pos minoopos, int stat, )
        //{
        //    this.minoopos = minoopos;
        //    this.stat = stat;
        //    idx = 0;
        //    spinlast = false;
        //    path = new int[32];


        //}
        //public mino_stat clone()
        //{
        //    mino_stat cp = new mino_stat();
        //    cp.path = (int[])path.Clone();
        //    cp.stat = stat;
        //    cp.idx = idx;
        //    return cp;

        //}
        public mino_stat(pos minoopos, int stat, int idx, int[] path_old, int move, int movetime, bool spinlast = false, int repeat = 1)
        {
            this.minoopos = minoopos.clone();
            this.stat     = stat;
            this.spinlast = spinlast;
            path          = new int[52];
            path[idx]     = move;
            this.movetime = movetime + repeat;
            for (int i = 0; i < idx; ++i)
            {
                path[i] = path_old[i];
            }
            this.idx = idx + 1;
        }
Esempio n. 5
0
 private bool check_mino_ok(pos p)
 {
     for (int i = 0; i < piece.height; ++i)
     {
         for (int j = 0; j < piece.weight; ++j)
         {
             if (checkfield(i + p.x, j + p.y) &&
                 piece.minofield[i, j] != 0)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Esempio n. 6
0
 public bool check_mino_ok(ref simpboard field, pos p, int[,] minofield)
 {
     for (int i = 0; i < height; ++i)
     {
         for (int j = 0; j < weight; ++j)
         {
             if (field.checkfield(i + p.x, j + p.y) &&
                 minofield[i, j] != 0)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Esempio n. 7
0
 public void setpos(pos p)
 {
     this.minopos.x = p.x;
     this.minopos.y = p.y;
 }