Documentation
¶
Overview ¶
DEPRECATED: This package is deprecated. Use parable-bloom/tools/level-builder instead. Future versions will port this functionality to the new CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LevelRenderCmd = &cobra.Command{ Use: "level-render", Short: "Render a level to the terminal (ASCII/Unicode)", Long: `Render a level to the terminal for quick visual inspection. You can supply a file path with --file (-f) or a level id with --id (-i) (looks in assets/levels). `, Run: func(cmd *cobra.Command, _args []string) { isVerbose := utils.IsVerbose(cmd) log.Start("Rendering level") file, _ := cmd.Flags().GetString("file") id, _ := cmd.Flags().GetInt("id") style, _ := cmd.Flags().GetString("style") showCoords, _ := cmd.Flags().GetBool("coords") var level *common.Level var err error if file != "" { level, err = common.ReadLevel(file) if err != nil { log.Error("Failed to read level file: %v", err) return } } else if id != 0 { path := common.GetLevelFilePath(id, "assets/levels") if !common.FileExists(path) { log.Error("Level file not found: %s", path) return } level, err = common.ReadLevel(path) if err != nil { log.Error("Failed to read level file: %v", err) return } } else { log.Error("Please provide either --file or --id to render a level") return } if style == "" { style = "unicode" } RenderLevelToWriter(cmd.OutOrStdout(), level, style, showCoords) log.Verbose(isVerbose, "Render complete") }, }
LevelRenderCmd prints a visual representation of a level to the terminal.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.