Example #1
0
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
}
Example #2
0
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
}
Example #3
0
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
}
Example #4
0
func (vg *VisGroups) ToKeyValues() *keyvalues.KeyValues {
	var kv keyvalues.KeyValues

	visgroups := kv.NewSubKey("visgroups")

	for _, group := range *vg {
		visgroups.Append(group.ToKeyValues())
	}

	return visgroups
}