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