Exemplo n.º 1
0
        public static void Cut(BoardSettings boardSettings, CutSettings cutSettings)
        {
            cutSettings.horizontalCuts = new float[boardSettings.horizontalCutAmount];
            cutSettings.verticalCuts   = new float[boardSettings.verticalCutAmount];

            CutHorizontal(boardSettings, cutSettings);
            CutVertical(boardSettings, cutSettings);
        }
Exemplo n.º 2
0
        private static void CutVertical(BoardSettings boardSettings, CutSettings cutSettings)
        {
            int amount = cutSettings.verticalCuts.Length;

            if (amount == 0)
            {
                return;
            }

            float[] fractions = GetFractions(amount);
            for (int i = 0; i < amount; i++)
            {
                cutSettings.verticalCuts[i] = fractions[i] * boardSettings.boardHeight;
            }
        }