添加项目文件。

This commit is contained in:
lichx
2024-03-22 17:03:01 +08:00
parent 4be5fbf32c
commit d610e431a8
72 changed files with 3106 additions and 0 deletions
@@ -0,0 +1,39 @@
namespace CDSAE3_Lian_Lian_Kan
{
partial class Challenge_Mode_MenuForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Challenge_Mode_MenuForm";
}
#endregion
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CDSAE3_Lian_Lian_Kan
{
public partial class Challenge_Mode_MenuForm : Form
{
public Challenge_Mode_MenuForm()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+62
View File
@@ -0,0 +1,62 @@
namespace CDSAE3_Lian_Lian_Kan.Forms
{
partial class GameControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
playPanel = new TableLayoutPanel();
SuspendLayout();
//
// playPanel
//
playPanel.BackColor = Color.FromArgb(0, 0, 0, 0);
playPanel.ColumnCount = 1;
playPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
playPanel.Dock = DockStyle.Fill;
playPanel.Location = new Point(0, 0);
playPanel.Name = "playPanel";
playPanel.RowCount = 1;
playPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
playPanel.Size = new Size(1400, 800);
playPanel.TabIndex = 1;
//
// GameControl
//
AutoScaleDimensions = new SizeF(11F, 24F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.FromArgb(0, 0, 0, 0);
Controls.Add(playPanel);
Name = "GameControl";
Size = new Size(1400, 800);
ResumeLayout(false);
}
#endregion
private TableLayoutPanel playPanel;
}
}
+206
View File
@@ -0,0 +1,206 @@
using CDSAE3_Lian_Lian_Kan.Board_funcs;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public partial class GameControl : UserControl, IBeSelected
{
Board board = new Board();
IGameMode iGameMode;
public GameControl()
{
InitializeComponent();
board.make_board();
Settings.game_form = this;
playPanel_set();
iGameMode = Settings.game_mode_form;
}
void playPanel_set()
{
int[,] bd;
if (board.Bd == null)
{
board.make_board();
bd = board.Bd ?? new int[0, 0];
if (bd.Length == 0)
throw new Exception("bd is null");
}
else
bd = board.Bd;
playPanel_size_change();
for (int i = 0; i < playPanel.RowCount; i++)
for (int j = 0; j < playPanel.ColumnCount; j++)
{
if (bd[i, j] == -1)
{
var x = new Single_Block(Settings.trans_Image, (j, i));
x.Dock = DockStyle.Fill;
playPanel.Controls.Add(x, j, i);
}
else
{
var x = new Single_Block(bd[i, j], Settings.def_Color, Settings.sel_Color, (j, i));
x.Dock = DockStyle.Fill;
playPanel.Controls.Add(x, j, i);
}
}
}
Queue<((int, int), Single_Block)> queue = new Queue<((int, int), Single_Block)>();//y,x
public void Selected_Handler(Single_Block sender, SelectedEventArgs e)
{
Task.Run(() =>
{
iGameMode.De_pause(this, e);
if (e.be_selected)
{
switch (queue.Count)
{
case 0:
queue.Enqueue((e.position, sender));
break;
case 1:
var (posa, sendera) = queue.Dequeue();
var posb = e.position;
var (could, path) = board.test(posa, posb);
if (could)
{
_ = Block_ClearAsync(path);
while (queue.Count() > 0)
queue.Dequeue();
if (board.Bd is null) throw new Exception("No usable board. How come?");
board.Bd[posa.Item2, posa.Item1] = -1;
board.Bd[posb.Item2, posb.Item1] = -1;
}
else
{
queue.Enqueue((e.position, sender));
sendera.deselect();
}
break;
}
}
else
{
switch (queue.Count)
{
case 0:
break;
case 1:
if (queue.Peek().Item1 == e.position)
queue.Dequeue();
break;
}
}
});
}
async Task Block_ClearAsync(List<(int, int)>? path)
{
List<Single_Block> paths = new List<Single_Block>();
if (path == null)
return;
Func<(int, int), (int, int), Settings.Direction> get_Direction = ((int, int) from, (int, int) to) =>//x,y
{
if (from.Item1 == to.Item1)
if (from.Item2 > to.Item2)
return Settings.Direction.up;
else
return Settings.Direction.down;
else
if (from.Item1 > to.Item1)
return Settings.Direction.left;
else
return Settings.Direction.right;
};
Func<(int, int), Settings.Direction, Task> set_Path = async ((int, int) point, Settings.Direction direction) =>
{
await Task.Delay(20);
Control? control = playPanel.GetControlFromPosition(point.Item1, point.Item2);
if (control != null && control is Single_Block single_Block)
{
single_Block.to_path(direction);
paths.Add(single_Block);
}
};
Func<(int, int), (int, int), bool, Settings.Direction, Task> to_path = async ((int, int) from, (int, int) to, bool include_end, Settings.Direction extra_Direction) =>
{
var direction = get_Direction(from, to);
switch (direction)
{
case Settings.Direction.up:
for (int i = from.Item2 - 1; i != to.Item2; i--)
await set_Path((from.Item1, i), Settings.Direction.up_down);
break;
case Settings.Direction.down:
for (int i = from.Item2 + 1; i != to.Item2; i++)
await set_Path((from.Item1, i), Settings.Direction.up_down);
break;
case Settings.Direction.right:
for (int i = from.Item1 + 1; i != to.Item1; i++)
await set_Path((i, from.Item2), Settings.Direction.left_right);
break;
case Settings.Direction.left:
for (int i = from.Item1 - 1; i != to.Item1; i--)
await set_Path((i, from.Item2), Settings.Direction.left_right);
break;
}
if (include_end)
{
direction = direction | extra_Direction;
await set_Path(to, direction);
}
};
switch (path.Count)
{
case 2:
await to_path(path[0], path[1], false, 0);
break;
case 3:
var extra_direction = get_Direction(path[1], path[2]);
await to_path(path[0], path[1], true, extra_direction);
await to_path(path[1], path[2], false, Settings.Direction.none);
break;
case 4:
Settings.Direction extra_directionA = get_Direction(path[1], path[2]), extra_directionB = get_Direction(path[2], path[3]);
await to_path(path[0], path[1], true, extra_directionA);
await to_path(path[1], path[2], true, extra_directionB);
await to_path(path[2], path[3], false, Settings.Direction.none);
break;
}
Control? controlA = playPanel.GetControlFromPosition(path[0].Item1, path[0].Item2), controlB = playPanel.GetControlFromPosition(path.Last().Item1, path.Last().Item2);
if (controlA != null && controlB != null && controlA is Single_Block single_BlockA && controlB is Single_Block single_BlockB)
{
single_BlockA.destroyAsync();
single_BlockB.destroyAsync();
}
await Task.Delay(200);
foreach (var control in paths)
control.de_path();
iGameMode.Score_Add(this, new AddScoreArgs { score = (paths.Count + 2)*10 });
board.Total -= 2;
}
void playPanel_size_change()
{
var (width, height) = board.size;
playPanel.RowCount = height + 2;
playPanel.ColumnCount = width + 2;
playPanel.ColumnStyles[0] = new ColumnStyle(SizeType.Percent, 100F);
playPanel.RowStyles[0] = new RowStyle(SizeType.Percent, 100F);
for (int i = 0; i < width + 1; i++)
playPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
for (int i = 0; i < height + 1; i++)
playPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+39
View File
@@ -0,0 +1,39 @@
namespace CDSAE3_Lian_Lian_Kan.Forms
{
partial class GameForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "GameForm";
}
#endregion
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public partial class GameForm : Form
{
public GameForm()
{
InitializeComponent();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public interface IBeSelected
{
public void Selected_Handler(Single_Block sender, SelectedEventArgs e);
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public class AddScoreArgs : EventArgs
{
public int score { get; set; }
}
public class FinishArgs: EventArgs
{
public enum Finish_Type
{
All_done = 0,
Time_out = 1
}
public Finish_Type finish_Type { get; set; }
}
public interface IGameMode
{
public void De_pause(object sender, EventArgs e);
public void Score_Add(object sender, AddScoreArgs e);
public void Finished_Handler(object sender, FinishArgs e);
}
}
+207
View File
@@ -0,0 +1,207 @@
namespace CDSAE3_Lian_Lian_Kan.Forms
{
partial class Leisure_Mode
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
game_Panel = new Panel();
gameControl = new GameControl();
back = new PictureBox();
energy_bar = new ProgressBar();
Score_Label = new Label();
factor = new Label();
time = new Label();
score = new Label();
sp_button = new PictureBox();
search = new PictureBox();
exchange = new PictureBox();
game_Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)back).BeginInit();
((System.ComponentModel.ISupportInitialize)sp_button).BeginInit();
((System.ComponentModel.ISupportInitialize)search).BeginInit();
((System.ComponentModel.ISupportInitialize)exchange).BeginInit();
SuspendLayout();
//
// game_Panel
//
game_Panel.BackColor = Color.FromArgb(50, 0, 0, 0);
game_Panel.Controls.Add(gameControl);
game_Panel.Location = new Point(20, 143);
game_Panel.Name = "game_Panel";
game_Panel.Size = new Size(1400, 800);
game_Panel.TabIndex = 0;
//
// gameControl
//
gameControl.BackColor = Color.FromArgb(0, 0, 0, 0);
gameControl.Dock = DockStyle.Fill;
gameControl.Location = new Point(0, 0);
gameControl.Name = "gameControl";
gameControl.Size = new Size(1400, 800);
gameControl.TabIndex = 0;
//
// back
//
back.BackColor = Color.FromArgb(249, 211, 171);
back.Image = Properties.Resources.left_arrow;
back.Location = new Point(30, 31);
back.Name = "back";
back.Size = new Size(70, 70);
back.SizeMode = PictureBoxSizeMode.Zoom;
back.TabIndex = 1;
back.TabStop = false;
back.Click += back_Click;
//
// energy_bar
//
energy_bar.Location = new Point(644, 48);
energy_bar.Name = "energy_bar";
energy_bar.Size = new Size(386, 34);
energy_bar.Step = 1;
energy_bar.TabIndex = 2;
//
// Score_Label
//
Score_Label.AutoSize = true;
Score_Label.BackColor = Color.FromArgb(249, 211, 171);
Score_Label.Font = new Font("Microsoft YaHei UI", 18F);
Score_Label.Location = new Point(1093, 43);
Score_Label.Name = "Score_Label";
Score_Label.Size = new Size(128, 46);
Score_Label.TabIndex = 3;
Score_Label.Text = "分数:";
//
// factor
//
factor.AutoSize = true;
factor.BackColor = Color.FromArgb(249, 211, 171);
factor.Font = new Font("Microsoft YaHei UI", 18F);
factor.Location = new Point(578, 42);
factor.Name = "factor";
factor.Size = new Size(59, 46);
factor.TabIndex = 4;
factor.Text = "x1";
//
// time
//
time.AutoSize = true;
time.BackColor = Color.FromArgb(249, 211, 171);
time.Font = new Font("Microsoft YaHei UI", 18F);
time.Location = new Point(195, 43);
time.Name = "time";
time.Size = new Size(113, 46);
time.TabIndex = 6;
time.Text = "00:00";
//
// score
//
score.AutoSize = true;
score.BackColor = Color.FromArgb(249, 211, 171);
score.Font = new Font("Microsoft YaHei UI", 18F);
score.Location = new Point(1214, 43);
score.Name = "score";
score.Size = new Size(104, 46);
score.TabIndex = 7;
score.Text = "0000";
//
// sp_button
//
sp_button.BackColor = Color.FromArgb(249, 211, 171);
sp_button.Image = Properties.Resources.play_buttton;
sp_button.Location = new Point(1350, 31);
sp_button.Name = "sp_button";
sp_button.Size = new Size(70, 70);
sp_button.SizeMode = PictureBoxSizeMode.Zoom;
sp_button.TabIndex = 8;
sp_button.TabStop = false;
sp_button.Click += Sp_button_Click;
//
// search
//
search.BackColor = Color.FromArgb(249, 211, 171);
search.Image = Properties.Resources.search;
search.Location = new Point(360, 31);
search.Name = "search";
search.Size = new Size(70, 70);
search.SizeMode = PictureBoxSizeMode.Zoom;
search.TabIndex = 9;
search.TabStop = false;
//
// exchange
//
exchange.BackColor = Color.FromArgb(249, 211, 171);
exchange.Image = Properties.Resources.exchange;
exchange.Location = new Point(455, 31);
exchange.Name = "exchange";
exchange.Size = new Size(70, 70);
exchange.SizeMode = PictureBoxSizeMode.Zoom;
exchange.TabIndex = 10;
exchange.TabStop = false;
//
// Leisure_Mode
//
AutoScaleDimensions = new SizeF(11F, 24F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.FromArgb(249, 211, 171);
ClientSize = new Size(1439, 960);
Controls.Add(exchange);
Controls.Add(search);
Controls.Add(sp_button);
Controls.Add(score);
Controls.Add(time);
Controls.Add(factor);
Controls.Add(Score_Label);
Controls.Add(energy_bar);
Controls.Add(back);
Controls.Add(game_Panel);
FormBorderStyle = FormBorderStyle.None;
Name = "Leisure_Mode";
Text = "Leisure_Mode";
game_Panel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)back).EndInit();
((System.ComponentModel.ISupportInitialize)sp_button).EndInit();
((System.ComponentModel.ISupportInitialize)search).EndInit();
((System.ComponentModel.ISupportInitialize)exchange).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Panel game_Panel;
private PictureBox back;
private ProgressBar energy_bar;
private Label Score_Label;
private Label factor;
private Label time;
private Label score;
private PictureBox sp_button;
private PictureBox search;
private PictureBox exchange;
private GameControl gameControl;
}
}
+127
View File
@@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CDSAE3_Lian_Lian_Kan.Board_funcs;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public partial class Leisure_Mode : Form, IGameMode
{
public Leisure_Mode()
{
Settings.game_mode_form = this;
InitializeComponent();
timer = new System.Timers.Timer();
timer.Enabled = false;
timer.Interval = 1000;
timer.Elapsed += Timer_Tick;
time.Text = (left_time / 60).ToString().PadLeft(2, '0') + ":" + (left_time % 60).ToString().PadLeft(2, '0');
}
System.Timers.Timer timer;
int left_time = Settings.left_time;
bool is_pause = true;
int cur_score = 0;
int factor_val = 1;
int current_base = 0;
Dictionary<int, double> decrease_per_level = Settings.decrease_per_level;
private void Timer_Tick(object? sender, EventArgs e)
{
left_time--;
BeginInvoke(() => time.Text = (left_time / 60).ToString().PadLeft(2, '0') + ":" + (left_time % 60).ToString().PadLeft(2, '0'));
if (current_base <= 0)
{
if(factor_val>1)
{
current_base = 100;
factor_val--;
BeginInvoke(() => factor.Text = "x" + factor_val.ToString());
BeginInvoke(() => energy_bar.Value = current_base);
}
}
else
{
current_base -= (int)decrease_per_level[factor_val];
if (current_base < 0)
current_base = 0;
BeginInvoke(() => energy_bar.Value = current_base);
}
if (left_time < 0)
{
timer.Enabled = false;
Finished_Handler(this, new FinishArgs { finish_Type = FinishArgs.Finish_Type.Time_out });
}
if (is_pause) { timer.Enabled = false; }
}
public void De_pause(object sender, EventArgs e)
{
if (is_pause)
Sp_button_Click(sender, e);
}
public void Score_Add(object sender, AddScoreArgs e)
{
cur_score += e.score * factor_val;
current_base += e.score;
while(current_base>100)
{
if(factor_val>=10)
{
factor_val = 10;
current_base = 100;
}
else
{
current_base -= 100;
factor_val++;
}
}
BeginInvoke(()=>factor.Text = "x" + factor_val.ToString());
BeginInvoke(() => energy_bar.Value = current_base);
BeginInvoke(() => score.Text = cur_score.ToString());
}
public void Sp_button_Click(object sender, EventArgs e)
{
if (is_pause)
{
sp_button.Image = Properties.Resources.pause;
is_pause = false;
timer.Enabled = true;
}
else
{
sp_button.Image = Properties.Resources.play_buttton;
is_pause = true;
timer.Enabled = false;
}
}
public void Finished_Handler(object sender, FinishArgs e)
{
//TODO finish form
switch (e.finish_Type)
{
case FinishArgs.Finish_Type.All_done:
MessageBox.Show("Congratulation!");
break;
case FinishArgs.Finish_Type.Time_out:
MessageBox.Show("Time Out!");
break;
}
}
private void back_Click(object sender, EventArgs e)
{
Close();
Dispose();
timer.Close();
Settings.form?.change_form(new Leisure_Mode_MenuForm());
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,105 @@
namespace CDSAE3_Lian_Lian_Kan.Forms
{
partial class Leisure_Mode_MenuForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
to_table_of_scores = new Button();
to_settings = new Button();
start_Game = new Button();
to_Challenge_mode = new Button();
SuspendLayout();
//
// to_table_of_scores
//
to_table_of_scores.BackColor = Color.FromArgb(249, 211, 171);
to_table_of_scores.Font = new Font("Microsoft YaHei UI", 18F);
to_table_of_scores.Location = new Point(939, 363);
to_table_of_scores.Name = "to_table_of_scores";
to_table_of_scores.Size = new Size(172, 65);
to_table_of_scores.TabIndex = 0;
to_table_of_scores.Text = "积分榜";
to_table_of_scores.UseVisualStyleBackColor = false;
//
// to_settings
//
to_settings.BackColor = Color.FromArgb(249, 211, 171);
to_settings.Font = new Font("Microsoft YaHei UI", 18F);
to_settings.Location = new Point(939, 505);
to_settings.Name = "to_settings";
to_settings.Size = new Size(172, 65);
to_settings.TabIndex = 1;
to_settings.Text = "设置";
to_settings.UseVisualStyleBackColor = false;
//
// start_Game
//
start_Game.BackColor = Color.FromArgb(249, 211, 171);
start_Game.Font = new Font("Microsoft YaHei UI", 18F);
start_Game.Location = new Point(354, 363);
start_Game.Name = "start_Game";
start_Game.Size = new Size(172, 65);
start_Game.TabIndex = 2;
start_Game.Text = "开始游戏";
start_Game.UseVisualStyleBackColor = false;
start_Game.Click += start_Game_Click;
//
// to_Challenge_mode
//
to_Challenge_mode.BackColor = Color.FromArgb(249, 211, 171);
to_Challenge_mode.Font = new Font("Microsoft YaHei UI", 18F);
to_Challenge_mode.Location = new Point(354, 505);
to_Challenge_mode.Name = "to_Challenge_mode";
to_Challenge_mode.Size = new Size(172, 65);
to_Challenge_mode.TabIndex = 3;
to_Challenge_mode.Text = "挑战模式";
to_Challenge_mode.UseVisualStyleBackColor = false;
//
// Leisure_Mode_MenuForm
//
AutoScaleDimensions = new SizeF(11F, 24F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.MainPicture;
ClientSize = new Size(1440, 960);
Controls.Add(to_Challenge_mode);
Controls.Add(start_Game);
Controls.Add(to_settings);
Controls.Add(to_table_of_scores);
FormBorderStyle = FormBorderStyle.None;
Name = "Leisure_Mode_MenuForm";
Text = "MenuForm";
ResumeLayout(false);
}
#endregion
private Button to_table_of_scores;
private Button to_settings;
private Button start_Game;
private Button to_Challenge_mode;
}
}
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CDSAE3_Lian_Lian_Kan.Forms
{
public partial class Leisure_Mode_MenuForm : Form
{
public Leisure_Mode_MenuForm()
{
InitializeComponent();
}
private void start_Game_Click(object sender, EventArgs e)
{
Settings.form?.change_form(new Leisure_Mode());
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+60
View File
@@ -0,0 +1,60 @@
namespace CDSAE3_Lian_Lian_Kan
{
partial class LianLianKan
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
MainPanel = new Panel();
SuspendLayout();
//
// MainPanel
//
MainPanel.BackColor = SystemColors.Control;
MainPanel.Dock = DockStyle.Fill;
MainPanel.Location = new Point(0, 0);
MainPanel.Name = "MainPanel";
MainPanel.Size = new Size(1440, 960);
MainPanel.TabIndex = 0;
//
// LianLianKan
//
AutoScaleDimensions = new SizeF(11F, 24F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1440, 960);
Controls.Add(MainPanel);
MaximumSize = new Size(1462, 1016);
MinimumSize = new Size(1462, 1016);
Name = "LianLianKan";
Text = "连连看";
ResumeLayout(false);
}
#endregion
private Panel MainPanel;
}
}
+28
View File
@@ -0,0 +1,28 @@
using CDSAE3_Lian_Lian_Kan.Forms;
namespace CDSAE3_Lian_Lian_Kan
{
public partial class LianLianKan : Form
{
public LianLianKan()
{
InitializeComponent();
current_form = this;
change_form(new Leisure_Mode_MenuForm());
Settings.form = this;
}
Form current_form;
public void change_form(Form form)
{
if (current_form == form)
return;
current_form = form;
MainPanel.Controls.Clear();
form.TopLevel = false;
form.Dock = DockStyle.Fill;
MainPanel.Controls.Add(form);
GC.Collect();
form.Show();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+63
View File
@@ -0,0 +1,63 @@
namespace CDSAE3_Lian_Lian_Kan
{
partial class Single_Block
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
picture = new PictureBox();
((System.ComponentModel.ISupportInitialize)picture).BeginInit();
SuspendLayout();
//
// picture
//
picture.BackColor = Color.Transparent;
picture.Dock = DockStyle.Fill;
picture.Location = new Point(3, 3);
picture.Name = "picture";
picture.Size = new Size(34, 34);
picture.TabIndex = 0;
picture.TabStop = false;
picture.Click += picture_Click;
//
// Single_Block
//
AutoScaleDimensions = new SizeF(11F, 24F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Transparent;
Controls.Add(picture);
Name = "Single_Block";
Padding = new Padding(3);
Size = new Size(40, 40);
((System.ComponentModel.ISupportInitialize)picture).EndInit();
ResumeLayout(false);
}
#endregion
private PictureBox picture;
}
}
+135
View File
@@ -0,0 +1,135 @@
using CDSAE3_Lian_Lian_Kan.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
namespace CDSAE3_Lian_Lian_Kan
{
public partial class Single_Block : UserControl
{
public Single_Block()
{
InitializeComponent();
if (Settings.game_form == null)
throw new Exception("game_form is null but try to make a new Single_Block");
Selected += Settings.game_form.Selected_Handler;
}
public Single_Block(int image, Color default_backColor, Color select_Color, (int, int) pos)
{
block_id = image;
position = pos;
InitializeComponent();
Image_change(Settings.get_block_Image(image));
picture.SizeMode = PictureBoxSizeMode.Zoom;
nor_color = default_backColor;
sel_color = select_Color;
BackColor = default_backColor;
picture.BackColor = default_backColor;
if (Settings.game_form == null)
throw new Exception("game_form is null but try to make a new Single_Block");
Selected += Settings.game_form.Selected_Handler;
}
public Single_Block(Image image, (int, int) pos)
{
position = pos;
InitializeComponent();
picture.SizeMode = PictureBoxSizeMode.Zoom;
BackColor = Color.FromArgb(0, 0, 0, 0);
can_be_selected = false;
if (Settings.game_form == null)
throw new Exception("game_form is null but try to make a new Single_Block");
Selected += Settings.game_form.Selected_Handler;
}
int block_id;
Color nor_color;
Color sel_color;
public bool selected { get; set; } = false;
bool can_be_selected = true;
public (int, int) position { get; set; }//height,width
private void picture_Click(object sender, EventArgs e)
{
if (!can_be_selected)
return;
if (selected)
{
deselect();
Selected.Invoke(this, new SelectedEventArgs(position, false));
}
else
{
select();
Selected.Invoke(this, new SelectedEventArgs(position, true));
}
}
public void select()
{
selected = true;
BackColor = sel_color;
}
public void deselect()
{
selected = false;
BackColor = nor_color;
}
public void to_path(Settings.Direction direction)
{//TODO tube Image
Image_change(Settings.get_block_Image(0));
}
public void de_path()
{
Image_change(Settings.trans_Image);
}
System.Timers.Timer? timer = null;
public void destroyAsync()
{
Image_change(Settings.get_disappear_Images(block_id));
BackColor = Color.FromArgb(0, 0, 0, 0);
can_be_selected = false;
timer = new System.Timers.Timer();
timer.Interval = 500;
timer.Elapsed += Image_Clear;
timer.Enabled = true;
}
Object locker = new object();
public void Image_Clear(object? sender, ElapsedEventArgs e)
{
timer?.Stop();
Image_change(Settings.trans_Image);
}
public void Image_change(Image new_image)
{
try
{
lock (locker)
{
picture.Image = new_image;
}
}
catch(Exception)
{
Image_change(new_image);
//Console.WriteLine("test");
}
}
public event SelectedEventHandler Selected;
}
public class SelectedEventArgs : EventArgs
{
public SelectedEventArgs((int, int) pos, bool sel)//width,height sel for be_selected
{
position = pos;
be_selected = sel;
}
public (int, int) position { get; set; }//height,width
public bool be_selected { get; set; }
}
public delegate void SelectedEventHandler(Single_Block sender, SelectedEventArgs e);
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>