Exemplo n.º 1
0
 private static ProjectionPoint[] CellParse(EnterData.Figure.Point[] cells)
 {
     var axisPoint = cells.First(cell => cell.X == 0 && cell.Y == 0);
     var axisProjectionPoint = new ProjectionPoint(axisPoint.X, axisPoint.Y);
     var listCells = cells
         .Where(cell => !(cell.X == 0 && cell.Y == 0))
         .Select(cell => new ProjectionPoint(cell.X, cell.Y, axisProjectionPoint)).ToList();
     listCells.Add(axisProjectionPoint);
     return listCells.ToArray();
 }
Exemplo n.º 2
0
        public static Figure[] FigursParse(EnterData enterData)
        {
            EnterData.Figure[] figurs = enterData.Pieces;
            List<Figure> parseFigure = new List<Figure>();
            foreach(var figure in figurs)
            {
                parseFigure.Add(new Figure(CellParse(figure.Cells)));
            }

            return parseFigure.ToArray();
        }
Exemplo n.º 3
0
 public static PlayingField PlayingFieldParser(EnterData enterData)
 {
     return new PlayingField(enterData.Width, enterData.Height);
 }
Exemplo n.º 4
0
 public static Commander CommanderParse(EnterData enterData)
 {
     return new Commander(enterData.Commands);
 }