コード例 #1
0
 //copy ctor
 public block(block block)
 {
     _bLocal = block._bLocal;
     myColor = block.myColor;
 }
コード例 #2
0
 //shift right true if not out of bounds to the roght
 public static bool CantShiftRight(block block)//TODO keep moving when hit wall
 {
     //if (!(block is block arg)) return false;
     return(block._bLocal.X > drawer.ScaledWidth - 1);
 }
コード例 #3
0
 //fall: true if not out of bounds at the bottom
 public static bool cantfall(block block)
 {
     //if (!(block is block arg)) return false;
     return(block._bLocal.Y > drawer.ScaledHeight - 1);//|| block._bLocal.X > drawer.ScaledWidth || block._bLocal.X > 0;
 }
コード例 #4
0
 //3 predicates
 //shift left true if not out of bounds to the left
 public static bool CantShiftLeft(block block)//TODO keep moving when hit wall
 {
     //if (!(block is block arg)) return false;
     return(block._bLocal.X < 0);
 }