func (c *RGB) ToKeyValues() *keyvalues.KeyValues { var kv keyvalues.KeyValues color := kv.NewSubKey("color") color.SetValueString(fmt.Sprintf("%d %d %d", c.Red, c.Green, c.Blue)) return color }
func (vg *VisGroup) ToKeyValues() *keyvalues.KeyValues { var kv keyvalues.KeyValues visgroup := kv.NewSubKey("visgroup") visgroup.NewSubKey("name").SetValueString(vg.Name) visgroup.NewSubKey("visgroupid").SetValueInt(vg.ID) visgroup.Append(vg.Color.ToKeyValues()) return visgroup }
func (info *VersionInfo) ToKeyValues() *keyvalues.KeyValues { var kv keyvalues.KeyValues versioninfo := kv.NewSubKey("versioninfo") versioninfo.NewSubKey("editorversion").SetValueInt(info.EditorVersion) versioninfo.NewSubKey("editorbuild").SetValueInt(info.EditorBuild) versioninfo.NewSubKey("mapversion").SetValueInt(info.MapVersion) versioninfo.NewSubKey("formatversion").SetValueInt(info.FormatVersion) versioninfo.NewSubKey("prefab").SetValueBool(info.Prefab) return versioninfo }
func (vg *VisGroups) ToKeyValues() *keyvalues.KeyValues { var kv keyvalues.KeyValues visgroups := kv.NewSubKey("visgroups") for _, group := range *vg { visgroups.Append(group.ToKeyValues()) } return visgroups }