2025-06-20 16:26:39 +03:00
|
|
|
package game
|
|
|
|
|
2025-06-22 17:54:07 +03:00
|
|
|
import "github.com/google/uuid"
|
|
|
|
|
2025-06-20 16:26:39 +03:00
|
|
|
type Player struct {
|
2025-06-22 17:54:07 +03:00
|
|
|
id uuid.UUID
|
|
|
|
|
|
|
|
currentRoom *Room
|
2025-06-20 16:26:39 +03:00
|
|
|
}
|
|
|
|
|
2025-06-22 17:54:07 +03:00
|
|
|
func CreatePlayer(identity uuid.UUID, room *Room) *Player {
|
2025-06-20 16:26:39 +03:00
|
|
|
return &Player{
|
2025-06-22 17:54:07 +03:00
|
|
|
id: identity,
|
|
|
|
currentRoom: room,
|
2025-06-20 16:26:39 +03:00
|
|
|
}
|
|
|
|
}
|
2025-06-22 17:54:07 +03:00
|
|
|
|
2025-06-22 22:27:56 +03:00
|
|
|
func (p *Player) Identity() uuid.UUID {
|
|
|
|
return p.id
|
2025-06-22 17:54:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Player) SetRoom(r *Room) {
|
|
|
|
p.currentRoom = r
|
|
|
|
}
|
2025-06-22 22:27:56 +03:00
|
|
|
|
|
|
|
func (p *Player) CurrentRoom() *Room {
|
|
|
|
return p.currentRoom
|
|
|
|
}
|