Beispiel #1
0
 public void setTetrimino(BTetrisTransform tetrimino, bool val)
 {
     tetrimino.toCoordArray().ForEach(block =>
     {
         setBit((int)block.x, (int)block.y, (int)block.z, val);
     });
 }
Beispiel #2
0
    bool canRotate(BTetrisTransform tetrimino, TetriminoConfig.RotationType rotationType, Vector3 translation)
    {
        //if(tetrimino)
        var points = tetrimino.toCoordArray(translation, rotationType);

        return(
            points.All(point => this.field.pointInField(point)) &&
            !this.field.collides(points));
    }
Beispiel #3
0
 public bool collides(BTetrisTransform tetrimino)
 {
     return(this.collides(tetrimino.toCoordArray()));
 }
Beispiel #4
0
 bool canMoveAgainstField(BTetrisTransform tetrimino, Vector3 direction)
 {
     return(this.field.collides(
                tetrimino.toCoordArray().Select(point => point + direction).ToList()
                ) == false);
 }