Move Accountant behind an interface

This commit is contained in:
Marc Di Luzio 2020-07-10 17:09:47 +01:00
parent c1267829ac
commit dc2800fa54
4 changed files with 111 additions and 85 deletions

View file

@ -29,7 +29,7 @@ type Server struct {
world *game.World
// Accountant
accountant *accounts.Accountant
accountant accounts.Accountant
// gRPC server
netListener net.Listener
@ -81,7 +81,7 @@ func NewServer(opts ...ServerOption) *Server {
persistence: EphemeralData,
schedule: cron.New(),
world: game.NewWorld(32),
accountant: accounts.NewAccountant(),
accountant: accounts.NewSimpleAccountant(),
}
// Apply all options