From 91cffd4866af215b6e5196b85a519c0a1a2994c0 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Fri, 31 May 2024 20:37:15 +0800 Subject: [PATCH] =?UTF-8?q?Adjust=20the=20test=20based=20on=20the=20time?= =?UTF-8?q?=20range=20of=20the=20room=20injector.=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=9F=BA=E4=BA=8E=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84=E6=88=BF=E9=97=B4=E6=B3=A8=E5=85=A5=E5=99=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/levelGraphs/test.json | 2 +- locals/Log.csv | 3 +- locals/Log.en.translation | Bin 1334 -> 1406 bytes locals/Log.jp.translation | Bin 1949 -> 2045 bytes locals/Log.zh.translation | Bin 1513 -> 1609 bytes .../TimeIntervalRoomInjectorProcessor.cs | 63 ++++++++++++------ scripts/utils/TimeUtils.cs | 5 +- 7 files changed, 50 insertions(+), 23 deletions(-) diff --git a/data/levelGraphs/test.json b/data/levelGraphs/test.json index 129664f..d6a41bd 100644 --- a/data/levelGraphs/test.json +++ b/data/levelGraphs/test.json @@ -46,7 +46,7 @@ "res://prefab/roomTemplates/dungeon/" ], "Tags": null, - "RoomInjectionProcessorData": "[\n {\n \"Id\": \"Chance\",\n \"Config\": \"{\\\"Chance\\\":35.5}\"\n }\n]" + "RoomInjectionProcessorData": "[\n {\n \"Id\": \"TimeInterval\",\n \"Config\": \"{\\\"DateSpecifiesLevel\\\":0,\\\"StartTime\\\":\\\"2024/1/1 20:34:23\\\",\\\"EndTime\\\":\\\"2025/1/1 20:34:23\\\"}\"\n }\n]" } ] } \ No newline at end of file diff --git a/locals/Log.csv b/locals/Log.csv index 2062ba1..a60b247 100644 --- a/locals/Log.csv +++ b/locals/Log.csv @@ -16,4 +16,5 @@ failed_to_calculate_the_room_location,计算房间{0}位置时失败。,Failed t place_existing_rooms,放置已存在的房间{0}。,Place existing rooms {0}.,既存の部屋を置きます{0}。 room_placement_failed,房间{0}放置失败。,Room {0} placement failed.,部屋{0}の放置に失敗します。 room_placement_information,房间{0}已被成功放置在{1}。,Room {0} has been successfully placed in {1}.,部屋{0}を{1}に配置しました。 -room_injection_processor_does_not_exist,找不到房间注入处理器{0},请检测是否在MapGenerator内注册。,"Room injection processor {0} not found, check to see if it is registered in MapGenerator.",部屋注入プロセッサ{0}が見つかりません、MapGenerator内に登録されているかどうか検出してください。 \ No newline at end of file +room_injection_processor_does_not_exist,找不到房间注入处理器{0},请检测是否在MapGenerator内注册。,"Room injection processor {0} not found, check to see if it is registered in MapGenerator.",部屋注入プロセッサ{0}が見つかりません、MapGenerator内に登録されているかどうか検出してください。 +time_range_debug,当前时间:{0}起始时间:{1},结束时间{2},是否在范围内{3},"Current time: {0} Start time: {1}, end time {2}, whether in range {3}",現在時間:{0}開始時間:{1}終了時間{2}範囲内かどうか{3}です \ No newline at end of file diff --git a/locals/Log.en.translation b/locals/Log.en.translation index 8a37c694e9fa202006d2c6d0a0a3190995e27462..3607ef0cf673ea6b17a27beb4a0e586752dffadc 100644 GIT binary patch delta 144 zcmdnS^^a?VG$U)iQAUQvWCg}H!6*g>hW|jo3ZxZ)IA!y8Mq@@s=E<*_)OlH6sC<6N z$iQF;lyIBO&uq*j#kARl`7xvWKj&$R0ep{`{#h~nXR0=+W%w6-;uD;2SgT^(_J|uO hV^phhh>6iVvnho8KXbKlEzlr#AO@Pr5ELBb3;@L~EFS;> delta 74 zcmeyzwT)|oG$U(nN@}9fWCg}H!7v5}hW|jo3ZxZ)IAQa4Mq@@srpd3F)F&%38!$a& W+#JIEn2{eS#}34dKpYet8_%4F7?E6-X-pamwanjK++N%#(jHsq?bDQ2A`b z!oc7Ml<=D@$85~lwK<5{o+aja|GuYlRy>>8^m5u{t7?PVm(#kRF7Jl%4QrooZF;h+ z4Z^QBs(rq`<>~BAPup4_H+Da6T=}@M4alfAu6^9N{Bh$uJ?%)y% diff --git a/locals/Log.zh.translation b/locals/Log.zh.translation index b125571b95d7bb117f6fe66494d55b30c2afa6cc..e819175472127e1f95059889fef841fb551c5e4c 100644 GIT binary patch delta 165 zcmaFKeUfK`G$U(?p_zfjWCg~lf>8_%4F7?E6-X-pamwanjK++N%#(jHsq?bDQ2E@> z#K7PWl<=P{$85}aZF3NF7gOxhy_27I_CA}w?d9|>@Au5AHmH5Eb^Fuh-3SrG+V^{U zp6{OgZ0>xBV6_oQ)iYtv0R&n$8Zyj6fU|9OMiD#X(8< delta 71 zcmX@f^OAdmG$U(9kwvB1WCg~lf?*5{4F7?E6-X-pal+ - /// Whether to specify a year - /// 是否指定年份 + /// Date specifies the level + /// 日期指定的等级 /// /// - ///If true, then Year can be specified in StartTime and EndTime. The specified year is used to be executed only once in a given year, while configurations that do not specify a year are automatically replenished with the current year (performed annually). - ///如果为true,那么可以在StartTime和EndTime内指定Year。指定年份被用于在特定的年份仅执行一次,而未指定年份的配置会自动补充为当前年份(每年执行)。 + ///Level 0: Specify complete yyyy/MM/DD hh:mm:ss, level 1: yyyy (year automatically uses this year), Level 2: yyyy/MM (year and month automatically uses this month), Level 3: yyyy/MM/DD (automatically uses today), level 4: yyyy/MM/dd hh(The current hour is automatically used) + ///等级0:指定完整的yyyy/MM/dd hh:mm:ss,等级1:yyyy(年份自动采用今年),等级2:yyyy/MM(年份和月份自动采用本年本月),等级3:yyyy/MM/dd(自动采用今天),等级4:yyyy/MM/dd hh(自动采用当前小时) /// - public bool SpecifiedYear { get; set; } + public int? DateSpecifiesLevel { get; set; } /// /// Start time /// 起始时间 /// - /// - ///If the year is not specified, enter data in the format MM-DD hh:mm:ss. If the year is specified, enter data in the format yyyy-MM-dd hh:mm:ss. - ///若未指定年份,则可填入格式为MM-dd hh:mm:ss的数据,若指定了年份,那么请填入yyyy-MM-dd hh:mm:ss格式数据。 - /// public string? StartTime { get; set; } /// /// End time /// 结束时间 /// - /// - ///See StartTime - ///同StartTime - /// public string? EndTime { get; set; } } } \ No newline at end of file diff --git a/scripts/utils/TimeUtils.cs b/scripts/utils/TimeUtils.cs index 4e4c5d4..52bfc43 100644 --- a/scripts/utils/TimeUtils.cs +++ b/scripts/utils/TimeUtils.cs @@ -1,4 +1,5 @@ using System; +using ColdMint.scripts.debug; namespace ColdMint.scripts.utils; @@ -27,6 +28,8 @@ public static class TimeUtils var dtEndTime = Convert.ToDateTime(endTime); var compNum1 = DateTime.Compare(dateTime, dtStartTime); var compNum2 = DateTime.Compare(dateTime, dtEndTime); - return compNum1 >= 0 && compNum2 <= 0; + var result = compNum1 >= 0 && compNum2 <= 0; + LogCat.LogWithFormat("time_range_debug", dateTime, dtStartTime, dtEndTime, result); + return result; } } \ No newline at end of file