io.Read/WriteCloser iface

Minizbot2012 3 years ago
parent 78d95b3374
commit 6c39bc8afd

@ -2,9 +2,8 @@ package orbweaver
import ( import (
"encoding/binary" "encoding/binary"
"io"
"os" "os"
"fyne.io/fyne"
) )
//BINDING Map of Default Keys //BINDING Map of Default Keys
@ -39,13 +38,13 @@ func LoadKM(file string) *KeyMap {
} }
//SavePKMKeymap saves an orb after edit //SavePKMKeymap saves an orb after edit
func SavePKMKeymap(mapped *PKM, file fyne.URIWriteCloser) { func SavePKMKeymap(mapped *PKM, file io.WriteCloser) {
binary.Write(file, binary.LittleEndian, mapped) binary.Write(file, binary.LittleEndian, mapped)
file.Close() file.Close()
} }
//LoadPKMKeymap loads an orb for editing //LoadPKMKeymap loads an orb for editing
func LoadPKMKeymap(file fyne.URIReadCloser) *PKM { func LoadPKMKeymap(file io.ReadCloser) *PKM {
mapped := new(PKM) mapped := new(PKM)
binary.Read(file, binary.LittleEndian, mapped) binary.Read(file, binary.LittleEndian, mapped)
file.Close() file.Close()

Loading…
Cancel
Save