28 lines
501 B
Go
28 lines
501 B
Go
package game
|
|
|
|
import (
|
|
"local/sandbox/cards/src/config"
|
|
"local/sandbox/cards/src/storage"
|
|
"testing"
|
|
)
|
|
|
|
type Master struct {
|
|
config config.Config
|
|
storage Storage
|
|
locks *storage.RWLockMap
|
|
}
|
|
|
|
func NewMaster(config config.Config, s Storage) *Master {
|
|
return &Master{
|
|
config: config,
|
|
storage: s,
|
|
locks: storage.NewRWLockMap(),
|
|
}
|
|
}
|
|
|
|
func NewTestMaster(t *testing.T) *Master {
|
|
config := config.NewTestConfig(t)
|
|
storage := storage.NewStorage(config)
|
|
return NewMaster(config, storage)
|
|
}
|