From e5e7beb52c3860a2cf932ee3d74e72290ec08b84 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 23 Dec 2024 01:16:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=B8=80=E4=BA=9Breadyonly?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/AppMain/MsgBool.cs | 16 ++++++++++------ .../AppMain/NesEmulator/NesControllerMapper.cs | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs index e3e9d3a..b151d79 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs @@ -6,7 +6,10 @@ public struct MsgBool public string ErrorMsg; public bool Value; - public override string ToString() + //low C# readonly + //public override readonly string ToString() + + public override string ToString() { if (Value) { @@ -33,12 +36,13 @@ public struct MsgBool return msgBool.Value; } - //public static implicit operator (bool, string)(MsgBool msgBool) - //{ - // return (msgBool.Value, msgBool.ErrorMsg); - //} + //low C# + //public static implicit operator (bool, string)(MsgBool msgBool) + //{ + // return (msgBool.Value, msgBool.ErrorMsg); + //} - public static implicit operator string(MsgBool msgBool) + public static implicit operator string(MsgBool msgBool) { return msgBool.ToString(); } diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs index 461a11f..f60b903 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs @@ -137,8 +137,10 @@ namespace AxibugEmuOnline.Client m_keyListener = Controller.GetKey(m_hostController.ControllerIndex, m_buttonType); } } + //low C# readonly + //public readonly struct KeyListener - public struct KeyListener + public struct KeyListener { private readonly KeyCode m_key;