Pentomino Mirror(Pentomino p) { Pentomino n = new Pentomino(p.name, p.variant + 4, p.operations); n.content = new List <Point>(); Rectangle enclosure = p.Enclosure(); foreach (Point element in p.content) { Point newElement = new Point(enclosure.Width - 1 - element.X, element.Y); n.content.Add(newElement); } return(n); }
Pentomino Rotate(Pentomino p) { Pentomino n = new Pentomino(p.name, p.variant + 1, p.operations); n.content = new List <Point>(); Rectangle enclosure = p.Enclosure(); foreach (Point element in p.content) { Point newElement = new Point(enclosure.Height - 1 - element.Y, element.X); n.content.Add(newElement); } return(n); }