mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-12-05 16:16:36 +00:00
更名
This commit is contained in:
parent
d19614dd5a
commit
2fda337efb
@ -11,7 +11,7 @@ namespace Desktop
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new ChessBoardExample.Form1());
|
Application.Run(new ChessBoardExample.ChessBoardExample());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
namespace ChessBoardExample
|
namespace ChessBoardExample
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class ChessBoardExample
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
@ -1,14 +1,14 @@
|
|||||||
namespace ChessBoardExample
|
namespace ChessBoardExample
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class ChessBoardExample : Form
|
||||||
{
|
{
|
||||||
const int gridSize = 12; // 每个小方块大小为40像素
|
const int gridSize = 32; // 每个小方块大小为40像素
|
||||||
const int step = 3; // 递进
|
const int step = 3; // 递进
|
||||||
|
|
||||||
Dictionary<string, Panel> chessboardDict = new Dictionary<string, Panel>();
|
Dictionary<string, Panel> chessboardDict = new Dictionary<string, Panel>();
|
||||||
HashSet<Panel> redPanelsSet = new HashSet<Panel>();
|
HashSet<Panel> redPanelsSet = new HashSet<Panel>();
|
||||||
|
|
||||||
public Form1()
|
public ChessBoardExample()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
InitializeChessboard();
|
InitializeChessboard();
|
||||||
@ -29,6 +29,8 @@
|
|||||||
if (redPanelsSet.Count > 0) SetOriginalCells();
|
if (redPanelsSet.Count > 0) SetOriginalCells();
|
||||||
else CheckRedCells(5, 9);
|
else CheckRedCells(5, 9);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Size = new Size(562, 562);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeChessboard()
|
private void InitializeChessboard()
|
||||||
@ -128,10 +130,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCellMouseEnter(object sender, System.EventArgs e)
|
private void OnCellMouseEnter(object? sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (sender is null) return;
|
||||||
// 获取当前鼠标进入区域对应格子位置;
|
// 获取当前鼠标进入区域对应格子位置;
|
||||||
string[] s = ((Panel)sender).Name.Split('_');
|
string[] s = ((Panel)sender).Name.Split('_');
|
||||||
int x = int.Parse(s[0]);
|
int x = int.Parse(s[0]);
|
||||||
@ -145,7 +148,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCellMouseLeave(object sender, EventArgs e)
|
private void OnCellMouseLeave(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetOriginalCells();
|
SetOriginalCells();
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user