func (importer *VmfImporter) loadVersionInfo(root *vmf.Node) (*valve.VersionInfo, error) {
	if root == nil {
		return nil, errors.New("missing versioninfo")
	}
	editorVersion, err := strconv.ParseInt(root.GetProperty("editorversion"), 10, 64)
	if err != nil {
		return nil, err
	}
	editorBuild, err := strconv.ParseInt(root.GetProperty("editorbuild"), 10, 64)
	if err != nil {
		return nil, err
	}
	mapVersion, err := strconv.ParseInt(root.GetProperty("mapversion"), 10, 64)
	if err != nil {
		return nil, err
	}
	formatVersion, err := strconv.ParseInt(root.GetProperty("formatversion"), 10, 64)
	if err != nil {
		return nil, err
	}
	prefab := false
	if root.GetProperty("prefab") != "0" {
		prefab = true
	}
	return valve.NewVersionInfo(int(editorVersion), int(editorBuild), int(mapVersion), int(formatVersion), prefab), nil
}
loadVersionInfo creates a VersionInfo model
from the versioninfo vmf block
package importers
import (
	"errors"
	"github.com/galaco/Lambda/internal/model/valve"
	"github.com/galaco/Lambda/internal/model/valve/world"
	"github.com/galaco/source-tools-common/entity"
	"github.com/galaco/vmf"
	"os"
	"strconv"
)
type VmfImporter struct {
}
func (importer *VmfImporter) LoadVmf(filepath string) (*valve.Vmf, error) {
	file, err := os.Open(filepath)
	if err != nil {
		return nil, err
	}
	defer file.Close()
	reader := vmf.NewReader(file)
	importable, err := reader.Read()
	if err != nil {
		return nil, err
	}
	versionInfo, err := importer.loadVersionInfo(&importable.VersionInfo)
	if err != nil || versionInfo == nil {
		return nil, err
	}
	visGroups, err := importer.loadVisGroups(&importable.VisGroup)
	if err != nil || visGroups == nil {
		return nil, err
	}
	worldspawn, err := importer.loadWorld(&importable.World)
	if err != nil || worldspawn == nil {
		return nil, err
	}
	cameras, err := importer.loadCameras(&importable.Cameras)
	if err != nil || cameras == nil {
		return nil, err
	}
	entities := importer.loadEntities(&importable.Entities)
	return valve.NewVmf(versionInfo, visGroups, worldspawn, entities, cameras), nil
}