Example #1
0
 public static string PrettyPrint(Unit unit)
 {
     var res = _PrettyPrint(unit.members, unit.pivot);
     #if DEBUG
     res += "Rotations:\n";
     for (int i = 0; i < 6; ++i)
     {
         res += string.Format("  #{0}: canonical {1}, cells: ", i, unit.GetCanonicalRotation(i));
         Cell[] cells = unit.GetRotatedCells(i);
         foreach (var c in cells)
             res += string.Format("({0}, {1}), ", c.x, c.y);
         res += "\n";
     }
     #endif
     return res;
 }
Example #2
0
 public Cell[] GetCells(Unit unit)
 {
     var cells = unit.GetRotatedCells(Rotation).ToArray();
     for (int i = 0; i < cells.Length; i++)
         cells[i] = RelatedCell(unit.pivot, Pivot, cells[i]);
     return cells;
 }