2025-06-26 23:48:54 +03:00
|
|
|
package data
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.haedhutner.dev/mvv/LastMUD/internal/ecs"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PlayerState = byte
|
|
|
|
|
|
|
|
const (
|
|
|
|
PlayerStateJoining PlayerState = iota
|
|
|
|
PlayerStatePlaying
|
|
|
|
PlayerStateLeaving
|
|
|
|
)
|
|
|
|
|
|
|
|
type PlayerStateComponent struct {
|
|
|
|
State PlayerState
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c PlayerStateComponent) Type() ecs.ComponentType {
|
|
|
|
return TypePlayerState
|
|
|
|
}
|
|
|
|
|
|
|
|
type InRoomComponent struct {
|
|
|
|
Room ecs.Entity
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c InRoomComponent) Type() ecs.ComponentType {
|
|
|
|
return TypeInRoom
|
|
|
|
}
|
|
|
|
|
|
|
|
type IsPlayerComponent struct{}
|
|
|
|
|
|
|
|
func (c IsPlayerComponent) Type() ecs.ComponentType {
|
|
|
|
return TypeIsPlayer
|
|
|
|
}
|
2025-06-29 18:21:22 +03:00
|
|
|
|
|
|
|
type InputComponent struct {
|
|
|
|
Input rune
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i InputComponent) Type() ecs.ComponentType {
|
|
|
|
return TypeInput
|
|
|
|
}
|
|
|
|
|
|
|
|
type InputBufferComponent struct {
|
|
|
|
HandlingEscapeCode bool
|
|
|
|
InputBuffer string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ib InputBufferComponent) Type() ecs.ComponentType {
|
|
|
|
return TypeInputBuffer
|
|
|
|
}
|