generated from VLADIMIR/template
37 lines
702 B
Go
37 lines
702 B
Go
// Package map_service handles game map operations.
|
|
package map_service
|
|
|
|
import "evening_detective_server/internal/repos/game_map_repo"
|
|
|
|
// MapItem describes an item placed on a game map.
|
|
type MapItem struct {
|
|
GameID int
|
|
Kind string
|
|
ItemID string
|
|
X int
|
|
Y int
|
|
Hidden bool
|
|
}
|
|
|
|
func mapItem(item game_map_repo.Item) *MapItem {
|
|
return &MapItem{
|
|
GameID: item.GameID,
|
|
Kind: item.Kind,
|
|
ItemID: item.ItemID,
|
|
X: item.X,
|
|
Y: item.Y,
|
|
Hidden: item.Hidden,
|
|
}
|
|
}
|
|
|
|
func toRepoItem(item *MapItem) game_map_repo.Item {
|
|
return game_map_repo.Item{
|
|
GameID: item.GameID,
|
|
Kind: item.Kind,
|
|
ItemID: item.ItemID,
|
|
X: item.X,
|
|
Y: item.Y,
|
|
Hidden: item.Hidden,
|
|
}
|
|
}
|