【修复】修复Luban重构导致LubanAssistant编译失败的问题
parent
dd25873b58
commit
18678059f4
|
|
@ -1,5 +1,7 @@
|
|||
using Luban.Job.Cfg.DataVisitors;
|
||||
#if !LUBAN_LITE
|
||||
using Luban.Job.Cfg.l10n;
|
||||
#endif
|
||||
|
||||
namespace Luban.Job.Cfg.Datas
|
||||
{
|
||||
|
|
@ -22,6 +24,7 @@ namespace Luban.Job.Cfg.Datas
|
|||
_rawValue = x;
|
||||
}
|
||||
|
||||
#if !LUBAN_LITE
|
||||
public string GetText(TextTable stringTable, NotConvertTextSet notConvertKeys)
|
||||
{
|
||||
if (stringTable != null)
|
||||
|
|
@ -37,6 +40,7 @@ namespace Luban.Job.Cfg.Datas
|
|||
}
|
||||
return _rawValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
public override void Apply<T>(IDataActionVisitor<T> visitor, T x)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Luban.Job.Cfg.Defs
|
|||
|
||||
public TimeZoneInfo TimeZone { get; }
|
||||
|
||||
public bool OutputCompactJson { get; init; }
|
||||
public bool OutputCompactJson { get; set; }
|
||||
|
||||
public DefAssembly(string patchName, TimeZoneInfo timezone, List<string> excludeTags, IAgent agent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,13 +25,15 @@ namespace Luban.Job.Cfg.Utils
|
|||
|
||||
private static void CreateValidatorsForArrayLike(TType containerType, TType elementType)
|
||||
{
|
||||
if (containerType.Tags.Remove("ref", out var refStr))
|
||||
if (containerType.Tags.TryGetValue("ref", out var refStr))
|
||||
{
|
||||
elementType.Tags.TryAdd("ref", refStr);
|
||||
elementType.Tags.Add("ref", refStr);
|
||||
containerType.Tags.Remove("ref");
|
||||
}
|
||||
if (containerType.Tags.Remove("path", out var pathStr))
|
||||
if (containerType.Tags.TryGetValue("path", out var pathStr))
|
||||
{
|
||||
elementType.Tags.TryAdd("path", pathStr);
|
||||
elementType.Tags.Add("path", pathStr);
|
||||
containerType.Tags.Remove("path");
|
||||
}
|
||||
|
||||
CreateValidatorsForType(elementType);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace Luban.Job.Cfg.Validators
|
|||
#if !LUBAN_LITE
|
||||
var pars = _str[1..^1].Split(',');
|
||||
#else
|
||||
var pars = _str.Substring(1, _str.Length - 1).Split(',');
|
||||
var pars = _str.Substring(1, _str.Length - 2).Split(',');
|
||||
#endif
|
||||
if (pars.Length != 2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -255,15 +255,15 @@
|
|||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\ExcelStreamDataCreator.cs">
|
||||
<Link>Source\DataCreators\ExcelStreamDataCreator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\InvalidExcelDataException.cs">
|
||||
<Link>Source\DataCreators\InvalidExcelDataException.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\JsonDataCreator.cs">
|
||||
<Link>Source\DataCreators\JsonDataCreator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\LuaDataCreator.cs">
|
||||
<Link>Source\DataCreators\LuaDataCreator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\MultiRowExcelDataCreator.cs">
|
||||
<Link>Source\DataCreators\MultiRowExcelDataCreator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\DataCreators\SheetDataCreator.cs">
|
||||
<Link>Source\DataCreators\SheetDataCreator.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -381,6 +381,12 @@
|
|||
<Compile Include="..\Luban.Job.Cfg\Source\Datas\DString.cs">
|
||||
<Link>Source\Datas\DString.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\Datas\DText.cs">
|
||||
<Link>Source\Datas\DText.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\Datas\DType.cs">
|
||||
<Link>Source\Datas\DType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\Datas\DVector2.cs">
|
||||
<Link>Source\Datas\DVector2.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -468,6 +474,9 @@
|
|||
<Compile Include="..\Luban.Job.Cfg\Source\Utils\DataUtil.cs">
|
||||
<Link>Source\Utils\DataUtil.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\Utils\ValidatorUtil.cs">
|
||||
<Link>Source\Utils\ValidatorUtil.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Cfg\Source\ValidatorContext.cs">
|
||||
<Link>Source\ValidatorContext.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -486,6 +495,9 @@
|
|||
<Compile Include="..\Luban.Job.Cfg\Source\Validators\ValidatorFactory.cs">
|
||||
<Link>Source\Validators\ValidatorFactory.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\AccessConvention.cs">
|
||||
<Link>Source\AccessConvention.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\Defs\CommonDefLoader.cs">
|
||||
<Link>Source\Defs\CommonDefLoader.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -504,9 +516,15 @@
|
|||
<Compile Include="..\Luban.Job.Common\Source\Defs\DefTypeBase.cs">
|
||||
<Link>Source\Defs\DefTypeBase.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\Defs\IProcessor.cs">
|
||||
<Link>Source\Defs\IProcessor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\ELanguage.cs">
|
||||
<Link>Source\ELanguage.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\NamingConvention.cs">
|
||||
<Link>Source\NamingConvention.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Luban.Job.Common\Source\RawDefs\Bean.cs">
|
||||
<Link>Source\RawDefs\Bean.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -636,9 +654,6 @@
|
|||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="focus_creative_games.pfx" />
|
||||
<None Include="LubanAssistant_1_TemporaryKey.pfx" />
|
||||
<None Include="LubanAssistant_2_TemporaryKey.pfx" />
|
||||
<None Include="LubanAssistant_TemporaryKey.pfx" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
|
|
@ -659,8 +674,6 @@
|
|||
<Compile Include="Source\Common\StringUtil.cs" />
|
||||
<Compile Include="Source\Common\TimeUtil.cs" />
|
||||
<Compile Include="Source\Common\ValueUtil.cs" />
|
||||
<Compile Include="Source\Datas\DText.cs" />
|
||||
<Compile Include="Source\Datas\DType.cs" />
|
||||
<Compile Include="Source\Protos\FileInfo.cs" />
|
||||
<Compile Include="Source\Protos\GetImportFileOrDirectory.cs" />
|
||||
<Compile Include="Source\LocalAgent.cs" />
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
using Luban.Job.Cfg.DataVisitors;
|
||||
|
||||
namespace Luban.Job.Cfg.Datas
|
||||
{
|
||||
public class DText : DType
|
||||
{
|
||||
public const string KEY_NAME = "key";
|
||||
public const string TEXT_NAME = "text";
|
||||
|
||||
public string Key { get; }
|
||||
|
||||
private readonly string _rawValue;
|
||||
|
||||
public string RawValue => _rawValue;
|
||||
|
||||
public override string TypeName => "text";
|
||||
|
||||
public DText(string key, string x)
|
||||
{
|
||||
Key = key;
|
||||
_rawValue = x;
|
||||
}
|
||||
|
||||
public override void Apply<T>(IDataActionVisitor<T> visitor, T x)
|
||||
{
|
||||
visitor.Accept(this, x);
|
||||
}
|
||||
|
||||
public override void Apply<T1, T2>(IDataActionVisitor<T1, T2> visitor, T1 x, T2 y)
|
||||
{
|
||||
visitor.Accept(this, x, y);
|
||||
}
|
||||
|
||||
public override TR Apply<TR>(IDataFuncVisitor<TR> visitor)
|
||||
{
|
||||
return visitor.Accept(this);
|
||||
}
|
||||
|
||||
public override TR Apply<T, TR>(IDataFuncVisitor<T, TR> visitor, T x)
|
||||
{
|
||||
return visitor.Accept(this, x);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is DText o && o._rawValue == this._rawValue && o.Key == this.Key;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _rawValue.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
|
||||
using Luban.Job.Cfg.DataVisitors;
|
||||
|
||||
namespace Luban.Job.Cfg.Datas
|
||||
{
|
||||
public abstract class DType
|
||||
{
|
||||
public abstract void Apply<T>(IDataActionVisitor<T> visitor, T x);
|
||||
|
||||
public abstract void Apply<T1, T2>(IDataActionVisitor<T1, T2> visitor, T1 x, T2 y);
|
||||
|
||||
public abstract TR Apply<TR>(IDataFuncVisitor<TR> visitor);
|
||||
|
||||
public abstract TR Apply<T, TR>(IDataFuncVisitor<T, TR> visitor, T x);
|
||||
|
||||
public abstract string TypeName { get; }
|
||||
}
|
||||
|
||||
public abstract class DType<T> : DType
|
||||
{
|
||||
public T Value { get; }
|
||||
|
||||
protected DType(T value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Value.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue