Esempio n. 1
0
        public override void Filter(bool[,] panelConfig, GeneratorState state)
        {
            var history = state.PanelHistory;

            if (history.Count < 2)
            {
                return;
            }

            var lastPanelIndex = PanelHistoryUtil.GetLastIndexOfLastNote(history);
            var lastFootIndex  = PanelHistoryUtil.GetIndexOfLastFoot(history, lastPanelIndex, history[lastPanelIndex].foot);
            var lastFootPanel  = history[lastFootIndex].panel;
            var historyRow     = lastFootPanel[0];
            var historyCol     = lastFootPanel[1];

            for (var row = 0; row < PanelConfigUtil.maxRows; row++)
            {
                for (var col = 0; col < PanelConfigUtil.maxColumns; col++)
                {
                    if (Math.Abs(row - historyRow) > maxHorizontalDistance || Math.Abs(col - historyCol) > maxVerticalDistance)
                    {
                        panelConfig[row, col] = false;
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Filter(bool[,] panelConfig, GeneratorState state)
        {
            var history      = state.PanelHistory;
            var historyIndex = PanelHistoryUtil.GetLastIndexOfLastNote(history);
            var noteCounter  = 0;

            while (historyIndex >= 0 && noteCounter < numNotes)
            {
                var historyItem = history[historyIndex];
                var panel       = historyItem.panel;
                var row         = panel[0];
                var col         = panel[1];

                panelConfig[row, col] = false;
                DisableAdjacentRows(panelConfig, row, col);

                noteCounter++;
                historyIndex = PanelHistoryUtil.GetIndexOfLastFoot(history, historyIndex, historyItem.foot);
            }
        }