LastMUD/internal/game/player.go

25 lines
353 B
Go
Raw Normal View History

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
func (p *Player) Identity() string {
return p.id.String()
}
func (p *Player) SetRoom(r *Room) {
p.currentRoom = r
}