Documentation ¶
Index ¶
- Constants
- func RemoveItemEntity(itemEntities *[]*item.ItemEntity, itemEntity *item.ItemEntity, ...) bool
- type ChatCommandData
- type ChatMessageClientData
- type ChatMessageData
- type CitizenUpdateStateData
- type Player
- func (p *Player) AddItem(ctx context.Context, client *ent.Client, gameItem item.Item, pickup bool) error
- func (p *Player) AddQuest(ctx context.Context, client *ent.Client, quest Quest) error
- func (p *Player) Move(x float32, y float32, direction string)
- func (p *Player) ReadPump(ctx context.Context, client *ent.Client)
- func (p *Player) Serialize() PlayerData
- func (p *Player) WritePump(ctx context.Context)
- type PlayerAddItemClientData
- type PlayerAddQuestClientData
- type PlayerData
- type PlayerMoveData
- type PlayerUpdateMapClientData
- type PlayerUpdateMapData
- type Quest
- type Relation
Constants ¶
View Source
const (
SETCOLOR = "setcolor"
)
Variables ¶
This section is empty.
Functions ¶
func RemoveItemEntity ¶
func RemoveItemEntity(itemEntities *[]*item.ItemEntity, itemEntity *item.ItemEntity, broadcastChan chan messages.BroadcastMessage) bool
Types ¶
type ChatCommandData ¶
Chatcommand we receive from client
type ChatMessageClientData ¶
type ChatMessageClientData struct { Message string `json:"message"` Author string `json:"author"` Timestamp int64 `json:"timestamp"` Color string `json:"color"` }
The parsed chat message that gets sent out
type ChatMessageData ¶
Chatmessage we receive from clients
type CitizenUpdateStateData ¶
type Player ¶
type Player struct { Conn *websocket.Conn Id uuid.UUID HustlerId string Name string CurrentMap string Direction string Position dopemap.Position LastPosition dopemap.Position GameItems []*item.ItemEntity Chatcolor string Items []item.Item Quests []Quest // messages sent to player Send chan messages.BaseMessage // messages broadcasted to the game server Unregister chan *Player Broadcast chan messages.BroadcastMessage }
func (*Player) Serialize ¶
func (p *Player) Serialize() PlayerData
type PlayerAddItemClientData ¶
type PlayerAddQuestClientData ¶
type PlayerAddQuestClientData struct {
Quest string `json:"quest"`
}
type PlayerData ¶
type PlayerMoveData ¶
type PlayerMoveData struct { Id string `json:"id"` X float32 `json:"x"` Y float32 `json:"y"` Direction string `json:"direction"` }
received from client, updates current pos
type PlayerUpdateMapClientData ¶
type PlayerUpdateMapClientData struct { Id string `json:"id"` CurrentMap string `json:"current_map"` X float32 `json:"x"` Y float32 `json:"y"` }
gets sent out to every other player
type PlayerUpdateMapData ¶
type PlayerUpdateMapData struct { CurrentMap string `json:"current_map"` X float32 `json:"x"` Y float32 `json:"y"` }
received from client
Click to show internal directories.
Click to hide internal directories.