Documentation
¶
Index ¶
- type MockPlayerManager
- func (m *MockPlayerManager) AddToInventory(ctx context.Context, playerID int64, ...) error
- func (m *MockPlayerManager) GetInventory(playerID int64) map[int64]int64
- func (m *MockPlayerManager) GetStats(playerID int64) []chunk.HarvestStatsUpdate
- func (m *MockPlayerManager) UpdateHarvestStats(ctx context.Context, playerID int64, update chunk.HarvestStatsUpdate) error
- type TestWorld
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPlayerManager ¶
type MockPlayerManager struct {
// contains filtered or unexported fields
}
MockPlayerManager implements chunk.PlayerManager for testing
func NewMockPlayerManager ¶
func NewMockPlayerManager() *MockPlayerManager
func (*MockPlayerManager) AddToInventory ¶
func (*MockPlayerManager) GetInventory ¶
func (m *MockPlayerManager) GetInventory(playerID int64) map[int64]int64
func (*MockPlayerManager) GetStats ¶
func (m *MockPlayerManager) GetStats(playerID int64) []chunk.HarvestStatsUpdate
func (*MockPlayerManager) UpdateHarvestStats ¶
func (m *MockPlayerManager) UpdateHarvestStats(ctx context.Context, playerID int64, update chunk.HarvestStatsUpdate) error
type TestWorld ¶
type TestWorld struct { DB *sql.DB ChunkManager *chunk.Manager PlayerManager *MockPlayerManager // contains filtered or unexported fields }
TestWorld represents a test world with database and chunk manager
func CreateTestWorld ¶
CreateTestWorld creates a new test world with a temporary database
func (*TestWorld) Cleanup ¶
func (tw *TestWorld) Cleanup()
Cleanup closes the database and removes the temporary file
func (*TestWorld) CreateInactiveTestNode ¶
func (tw *TestWorld) CreateInactiveTestNode(t *testing.T, chunkX, chunkZ, localX, localZ, nodeType int64) *chunk.ResourceNode
CreateInactiveTestNode creates a test node that is inactive/depleted
func (*TestWorld) CreateTestNode ¶
func (tw *TestWorld) CreateTestNode(t *testing.T, chunkX, chunkZ, localX, localZ, nodeType, yield int64) *chunk.ResourceNode
CreateTestNode creates a test node in the database
Click to show internal directories.
Click to hide internal directories.