Example #1
0
 public bool Fits(ITetrisCup intoCup1, Offset offset)
 {
     var intoCup = (TetrisCup)intoCup1;
     if (intoCup._size.StrictlyLess(this._size + offset))
         return false;
     if (offset.X < 0) return false;
     foreach (var point in AllCells)
         if (this[point] != 0 && intoCup[point + offset] != 0)
             return false;
     return true;
 }
Example #2
0
 public FitsResult Fits2(ITetrisCup lowerCup, Offset offset)
 {
     var lowerCup1 = (TetrisCup)lowerCup;
     if (lowerCup1._size.Width < (this._size.Width + offset.X))
         return FitsResult.RightObstacle;
     if (!this.Fits(lowerCup1, offset))
         return FitsResult.BottomObstacle;
     return FitsResult.Fits;
 }
Example #3
0
 public void CopyFrom(ITetrisCup upperLayer1, Offset offset, int color)
 {
     var upperLayer = (TetrisCup)upperLayer1;
     foreach (var point in upperLayer.AllCells)
         if (upperLayer[point] != 0)
             this[point + offset] = color;
 }