Esempio n. 1
0
        public void Visualize()
        {
            if (stopwatch.ElapsedMilliseconds <= 10)
            {
                return;
            }
            stopwatch.Restart();

            int triangles = config.stageSideLengths.Length / 3;

            for (int i = 0; i < triangles; i++)
            {
                int tracerIndex = TracerLEDIndex(
                    config,
                    i
                    );
                int triangleCounter = 0;
                for (int j = 0; j < 3; j++)
                {
                    for (
                        int k = 0;
                        k < config.stageSideLengths[i * 3 + j];
                        k++, triangleCounter++
                        )
                    {
                        int color = triangleCounter == tracerIndex
                          ? stage.GetSingleColor(0)
                          : stage.GetSingleColor(1);

                        for (int l = 0; l < 3; l++)
                        {
                            stage.SetPixel(i * 3 + j, k, l, color);
                        }
                    }
                }
            }
            stage.Flush();
        }