Extract persistence code into own class

This commit is contained in:
Marc Di Luzio 2020-06-02 19:16:02 +01:00
parent 4c76530832
commit c5ebbc3c40
9 changed files with 163 additions and 149 deletions

View file

@ -1,20 +1,19 @@
package game
import (
"os"
"testing"
)
func TestNewWorld(t *testing.T) {
// Very basic for now, nothing to verify
world := NewWorld(os.TempDir())
world := NewWorld()
if world == nil {
t.Error("Failed to create world")
}
}
func TestWorld_CreateInstance(t *testing.T) {
world := NewWorld(os.TempDir())
world := NewWorld()
a := world.CreateInstance()
b := world.CreateInstance()