Coder Social home page Coder Social logo

tabfileheadergenerator's Introduction

tabfile-header-generator

Usage:

  1. Make sure the tabfile which as your generate target have a comment line starts with #type= and follows by a type for each column which splitted by '\t' character.
  2. Support type:int, float, bool, l10n, int_array, string_array, float_array, bool_array, l10n_array
  3. The type which with prefix '_' means that Parser:Get will not be generated for the corresponding column, in other words, it will be ignored in programming.
  4. Make sure you have a function named OnParseLine so that generator can insert code in it.
  5. Define a tabfile path variable and assign a valid relative path to it.
  6. Select tabfile path string.
  7. Right click on the selected string.
  8. Select 'GenerateTabfileHeader' in the context menu.
  9. Several lines with Parser:Get will be generated in function OnParseLine.
DungeonDataTable.szFileName = "common/scene/dungeon.tab"
DungeonDataTable.tbContainer = {}

function DungeonDataTable:OnParseLine(Parser)
    local NewTemplate = {}
    NewTemplate.nId             = Parser:Get("id",                 -1, Parser.TypeInt,    true)
    NewTemplate.nResId          = Parser:Get("res_id",             -1, Parser.TypeInt,    true)
    NewTemplate.nGameModeId     = Parser:Get("game_mode_id",       -1, Parser.TypeInt,    true)
    NewTemplate.szGameMode      = Parser:Get("game_mode",          "", Parser.TypeString, true)
    NewTemplate.bIsPlane        = Parser:Get("is_plane",        false, Parser.TypeBool,   true)
    NewTemplate.szPlaneLocation = Parser:Get("plane_location",     "", Parser.TypeString, true)
    NewTemplate.nPlaneWidth     = Parser:Get("plane_width",        -1, Parser.TypeInt,    true)
    NewTemplate.nPlaneHeight    = Parser:Get("plane_height",       -1, Parser.TypeInt,    true)
    NewTemplate.nPlaneRotation  = Parser:Get("plane_rotation",     -1, Parser.TypeInt,    true)
    NewTemplate.nIdleCount      = Parser:Get("idle_count",         -1, Parser.TypeInt,    true)
    NewTemplate.nUIRadarMapId   = Parser:Get("ui_radar_map_id",    -1, Parser.TypeInt,    true)
    NewTemplate.nUIMapId        = Parser:Get("ui_map_id",          -1, Parser.TypeInt,    true)

    self.tbContainer[NewTemplate.nID] = NewTemplate     
    return true;
end

tabfileheadergenerator's People

Contributors

gcmiao 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.