mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-25 10:05:49 +08:00
* 多语言下拉框挪到其他设置下 * 使用正经的Fixture写法,杜绝并行测试时paddle崩溃的问题 * 适配不同主城的合成台的不同法语名 * 修正语言资源的正则表达式,好久没用了写错了好多;为AutoDomainTask新增的“地脉异常”、“点击任意位置关闭”添加多语言适配
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using BetterGenshinImpact.Core.Config;
|
|
using BetterGenshinImpact.Core.Recognition.OCR;
|
|
using BetterGenshinImpact.UnitTest.CoreTests.RecognitionTests.OCRTests;
|
|
using Compunet.YoloV8;
|
|
|
|
namespace BetterGenshinImpact.UnitTest.GameTaskTests.AutoFishingTests
|
|
{
|
|
[Collection("Paddle Collection")]
|
|
public partial class BehavioursTests
|
|
{
|
|
#pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
|
|
private static YoloV8Predictor predictor;
|
|
#pragma warning restore CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
|
|
|
|
private readonly PaddleFixture paddle;
|
|
public BehavioursTests(PaddleFixture paddle)
|
|
{
|
|
this.paddle = paddle;
|
|
}
|
|
|
|
private IOcrService OcrService
|
|
{
|
|
get
|
|
{
|
|
return this.paddle.Get();
|
|
}
|
|
}
|
|
|
|
private static YoloV8Predictor Predictor
|
|
{
|
|
get
|
|
{
|
|
return LazyInitializer.EnsureInitialized(ref predictor, () => YoloV8Builder.CreateDefaultBuilder().UseOnnxModel(Global.Absolute(@"Assets\Model\Fish\bgi_fish.onnx")).Build());
|
|
}
|
|
}
|
|
}
|
|
}
|