Example #1
0
        private static Line PredictLine(PredictionCollection currentPredictions)
        {
            if (currentPredictions.Count == 1)
            {
                return(currentPredictions[0]);
            }

            var currentPrediction = currentPredictions[0].ToBoxArray();

            foreach (var nextPrediction in currentPredictions.Skip(1))
            {
                for (int i = 0; i < currentPrediction.Length; i++)
                {
                    if (currentPrediction[i] != Box.Empty && currentPrediction[i] != nextPrediction[i])
                    {
                        currentPrediction[i] = Box.Empty;
                    }
                }
            }

            return(new Line(currentPrediction));
        }