From 83e581f08692474edfccf1ca9cbc8e1f293cca45 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sun, 7 Sep 2025 17:53:16 +0800 Subject: [PATCH] feat: add chessboard for simulator --- HFUTCourseSimulation/Dialog/Simulator.xaml.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HFUTCourseSimulation/Dialog/Simulator.xaml.cs b/HFUTCourseSimulation/Dialog/Simulator.xaml.cs index 7af8109..8e89aaf 100644 --- a/HFUTCourseSimulation/Dialog/Simulator.xaml.cs +++ b/HFUTCourseSimulation/Dialog/Simulator.xaml.cs @@ -126,6 +126,18 @@ namespace HFUTCourseSimulation.Dialog { Grid.SetRow(cornerLabel, 0); Grid.SetRowSpan(cornerLabel, 2); uiCoreGrid.Children.Add(cornerLabel); + // Add chessboard + for (int week = 1; week <= WEEK_NAMES.Length; ++week) { + for (int index = 1; index <= CurrentSemester.indexCount; ++index) { + if ((week + index) % 2 != 0) continue; + + var chessboard = new Rectangle(); + chessboard.Fill = new SolidColorBrush(Color.FromArgb(10, 0, 0, 0)); + Grid.SetColumn(chessboard, week - 1 + 1); + Grid.SetRow(chessboard, index - 1 + 2); + uiCoreGrid.Children.Add((chessboard)); + } + } // Render for week 1 currentWeek = 1;