GithubHelp home page GithubHelp logo

lua-dotable's Introduction

lua-doTable

build custom lua table files from input table files by codeing less in this project.

lua的二次导表工具

####依赖: LuaDist https://github.com/LuaDist/Binaries/archive/LuaDist-batteries-0.9.8-Windows-x86.zip ####用法:

cmd.exe lua.exe [thisproject]\main.lua [targetTablePath]

####换索引例子 待处理表

local ret = {
    [1] = {up_grading="a", },
    [2] = {up_grading="b", },
    [3] = {up_grading="c", },
    [4] = {up_grading="d", },
    [5] = {up_grading="e", },
    [6] = {up_grading="f", },
    [7] = {up_grading="g", },
    [8] = {up_grading="h", },
    [9] = {up_grading="i", },
    [10] = {up_grading="j", },
    [11] = {up_grading="k", },
    [12] = {up_grading="l", },
    [13] = {up_grading="m", },
    [14] = {up_grading="n", },
    [15] = {up_grading="o", },
};return ret;

处理完

local ret = {
    ['a']={ ['up_grading']='a', }, 
    ['b']={ ['up_grading']='b', }, 
    ['c']={ ['up_grading']='c', }, 
    ['d']={ ['up_grading']='d', }, 
    ['e']={ ['up_grading']='e', }, 
    ['f']={ ['up_grading']='f', }, 
    ['g']={ ['up_grading']='g', }, 
    ['h']={ ['up_grading']='h', }, 
    ['i']={ ['up_grading']='i', }, 
    ['j']={ ['up_grading']='j', }, 
    ['k']={ ['up_grading']='k', }, 
    ['l']={ ['up_grading']='l', }, 
    ['m']={ ['up_grading']='m', }, 
    ['n']={ ['up_grading']='n', }, 
    ['o']={ ['up_grading']='o', }, 
};return ret;

命令行输出

tablePath:F:\work\client\racing\Assets\Lua\game\logicModule\data
scriptPath:F:\work\doTable\
- "need_trans_table" = {
-     "club_level" = {
-         cc = *MAX NESTING*
-     }
- }
----begin do [club_level]----
[tip] export table file:        club_level_cc.lua
----end do [club_level]----     cost time:0s

换索引脚本

local cc = class("cc", global.doTableBase)

function cc.combine()
    return "club_level"
end

function cc:before(upTable)
    upTable = table.SetIndexField(upTable, "up_grading")
    return upTable
end

function cc:work(upTable)
    self:SetNewTable("cc", upTable)
    return upTable
end

function cc:after(upTable)
    self:ExportTable2File()
end

return cc

只要新增自定义脚本到custom目录,工具会自动识别运行喂食原表,产出新表。

lua-dotable's People

Contributors

ct1676 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.