@18xx-maker/export-rb 中文文档教程

发布于 4年前 浏览 23 项目主页 更新于 3年前

18xx-maker/export-rb

build版本 下载 license

这个包导出将 18xx-maker 数据加载到 ruby​​ 项目中所需的文件, 特别是 18xx.games 要求的格式。

Usage

您可以从节点或通过命令行使用此包。

CLI

当你全局安装这个包时:

npm install -g @18xx-maker/export-rb

你最终会得到一个可以直接输出所有图块或游戏文件的脚本:

# Render the tiles file
18xx-export-rb tiles

# Render some games
18xx-export-rb game 1830
18xx-export-rb game 1889

Node

要在节点中使用这个包:

const exportRb = require("@18xx-maker/export-rb");

// All tiles are in exportRb.tiles
// All games are in exportRb.games

// Render tiles
const tilesRb = exportRb.renderTiles(exportRb.tiles);

// Render a game
const gameRb = exportRb.renderGame(exportRb.games["1830"]);

// If you have a game json that's not from @18xx-maker/games
// you can render that too:
const otherGameRb = exportRb.renderGame(require("./18Awesome.json"));

18xx-maker/export-rb

buildversion downloads license

This package exports files needed to load 18xx-maker data into ruby projects, specifically in the format that 18xx.games requires.

Usage

You can use this package from node or via the command line.

CLI

When you npm install this package globaly:

npm install -g @18xx-maker/export-rb

you end up with a script that can output all tiles, or game files directly:

# Render the tiles file
18xx-export-rb tiles

# Render some games
18xx-export-rb game 1830
18xx-export-rb game 1889

Node

To use this package in node:

const exportRb = require("@18xx-maker/export-rb");

// All tiles are in exportRb.tiles
// All games are in exportRb.games

// Render tiles
const tilesRb = exportRb.renderTiles(exportRb.tiles);

// Render a game
const gameRb = exportRb.renderGame(exportRb.games["1830"]);

// If you have a game json that's not from @18xx-maker/games
// you can render that too:
const otherGameRb = exportRb.renderGame(require("./18Awesome.json"));
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文