MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / resolveNodeColors

Function resolveNodeColors

internal/mapper/mapper.go:960–977  ·  view source on GitHub ↗

resolveNodeColors returns the fg/bg ANSI color codes for a node+symbol, applying per-symbol biome overrides before falling back to the biome default.

(node *mapNode, symbol rune)

Source from the content-addressed store, hash-verified

958// resolveNodeColors returns the fg/bg ANSI color codes for a node+symbol,
959// applying per-symbol biome overrides before falling back to the biome default.
960func resolveNodeColors(node *mapNode, symbol rune) (fg, bg int) {
961 symStr := string(symbol)
962 if node.SymbolOverrides != nil {
963 if ov, ok := node.SymbolOverrides[symStr]; ok {
964 fg = ov.FGColor
965 bg = ov.BGColor
966 // Fill in biome default where override is zero
967 if fg == 0 {
968 fg = node.Color.FGColor
969 }
970 if bg == 0 {
971 bg = node.Color.BGColor
972 }
973 return fg, bg
974 }
975 }
976 return node.Color.FGColor, node.Color.BGColor
977}
978
979// arrowForDelta returns the connector rune that best represents the direction
980// from one room to another given the raw coordinate delta between them.

Callers 2

GetLimitedMapMethod · 0.85
GetFullMapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected