make context great again

This commit is contained in:
2019-11-14 22:28:58 +03:00
parent 3560be99a1
commit 6a37870bd2
12 changed files with 160 additions and 84 deletions

View File

@ -1,6 +1,7 @@
package gamemap
import (
"context"
"encoding/json"
"io/ioutil"
"lab.zaar.be/thefish/alchemyst-go/engine/items"
@ -42,10 +43,10 @@ func LoadPrefabFile(filename string) (*PrefabFile, error) {
}
type PrefabLoader struct {
ctx appctx.ClientCtx
ctx context.Context
}
func NewPrefabLoader(ctx appctx.ClientCtx) PrefabLoader {
func NewPrefabLoader(ctx context.Context) PrefabLoader {
return PrefabLoader{ctx: ctx}
}
@ -105,7 +106,7 @@ func (pfbl PrefabLoader) PrefabRoomsList() []Room {
} else {
f, ok = TileTypeMap[shortName]
if (!ok) {
pfbl.ctx.Logger().Warn().Msgf("Unknown tile: %s", shortName)
appctx.Logger(pfbl.ctx).Warn().Msgf("Unknown tile: %s", shortName)
}
}
room.Geometry[i+ j*room.W] = f