[opt] 优化生成的emmylua注解中的类型信息

main
walon 2022-09-07 17:53:54 +08:00
parent f25f91b94d
commit ad4acf337f
4 changed files with 18 additions and 17 deletions

View File

@ -44,6 +44,7 @@ luban统一了游戏配置开发工作流极大提升了策划和程序的工
## 文档
- [快速上手](https://focus-creative-games.github.io/luban/start_up/)
- [技术论坛](https://forum.focus-creative-games.com/topics)
- [Document](https://focus-creative-games.github.io/luban/) ,比较完善,有使用疑问,请先查看此文档。
- **示例项目** ([github](https://github.com/focus-creative-games/luban_examples)) ([gitee](https://gitee.com/focus-creative-games/luban_examples))
- [版本变更记录](https://focus-creative-games.github.io/luban/changelog/)

View File

@ -8,57 +8,57 @@ namespace Luban.Job.Common.TypeVisitors
public string Accept(TBool type)
{
return "bool";
return "boolean";
}
public string Accept(TByte type)
{
return "byte";
return "integer";
}
public string Accept(TShort type)
{
return "short";
return "integer";
}
public string Accept(TFshort type)
{
return "short";
return "integer";
}
public string Accept(TInt type)
{
return "int";
return "integer";
}
public string Accept(TFint type)
{
return "int";
return "integer";
}
public string Accept(TLong type)
{
return "long";
return "integer";
}
public string Accept(TFlong type)
{
return "long";
return "integer";
}
public string Accept(TFloat type)
{
return "float";
return "number";
}
public string Accept(TDouble type)
{
return "double";
return "number";
}
public string Accept(TEnum type)
{
return type.DefineEnum.FullName;
return "integer";
}
public string Accept(TString type)
@ -103,22 +103,22 @@ namespace Luban.Job.Common.TypeVisitors
public string Accept(TVector2 type)
{
return "vector2";
return "{x:number,y:number}";
}
public string Accept(TVector3 type)
{
return "vector3";
return "{x:number,y:number,z:number}";
}
public string Accept(TVector4 type)
{
return "vector4";
return "{x:number,y:number,z:number,w:number}";
}
public string Accept(TDateTime type)
{
return "int";
return "integer";
}
}
}

View File

@ -4,7 +4,7 @@ local enums =
{{~ for c in enums ~}}
---@class {{c.full_name}}
{{~ for item in c.items ~}}
---@field public {{item.name}} int
---@field public {{item.name}} integer
{{~end~}}
['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} };
{{~end~}}

View File

@ -3,7 +3,7 @@ local enums =
{{~ for c in enums ~}}
---@class {{c.full_name}}
{{~ for item in c.items ~}}
---@field public {{item.name}} int
---@field public {{item.name}} integer
{{~end~}}
['{{c.full_name}}'] = { {{ for item in c.items }} {{item.name}}={{item.int_value}}, {{end}} };
{{~end~}}