game_engine

package
v0.0.0-...-51e0d3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ServerUser string = "server"
View Source
const SpaceGame string = "./content/space/entities.yml"
View Source
const SpaceGameTest string = "../../content/space/entities.yml"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMapItem

type AddMapItem struct {
	EntityId string `json:"EntityId"`
	MapId    string `json:"MapId"`
}

type CampaignClient

type CampaignClient interface {
	GetId() string
	IsLead() bool
}

type CampaignPool

type CampaignPool interface {
	GetId() uint
	GetLeadId() string
	GetEngine() Engine
	TransmitEventMessage(message EventMessage)
	GetAllClientIds(filterOut ...string) []string
}

type Engine

type Engine interface {
	GetWorld() ecs.World
	GetEventMessageHandler() EventMessageHandler
}

func InitGameEngine

func InitGameEngine(campaign models.Campaign) Engine

type EventMessage

type EventMessage struct {
	Id           uuid.UUID `json:"-"`
	Source       string    `json:"source"`
	Destinations []string  `json:"-"`
	Type         EventType `json:"type"`
	Body         string    `json:"body"`
	DateTime     string    `json:"dateTime"`
}

func NewEventMessage

func NewEventMessage() EventMessage

func (*EventMessage) ReloadDateTime

func (m *EventMessage) ReloadDateTime()

type EventMessageHandler

type EventMessageHandler interface {
	HandleEventMessage(message EventMessage, pool CampaignPool) error
}

type EventMessageIdBody

type EventMessageIdBody struct {
	Id   string `json:"Id"`
	Html string `json:"Html"`
}

func (*EventMessageIdBody) ToBodyString

func (midBody *EventMessageIdBody) ToBodyString() string

type EventType

type EventType int
const (
	TypeGameClose EventType = 0
	TypeGameStart EventType = 1

	TypeUserJoin EventType = 400

	TypeLoadFullGame EventType = 500

	TypeLoadCharacters        EventType = 501
	TypeAddCharacter          EventType = 502
	TypeRemoveCharacter       EventType = 503
	TypeLoadCharactersDetails EventType = 504

	TypeUpdateCharacterHealth EventType = 511

	TypeLoadMap         EventType = 531
	TypeLoadMapEntities EventType = 532
	TypeLoadMapEntity   EventType = 533
	TypeAddMap          EventType = 534
	TypeRemoveMap       EventType = 535

	TypeUpdateMapEntity     EventType = 543
	TypeUpdateMapVisibility EventType = 544
	TypeAddMapItem          EventType = 545
	TypeRemoveMapItem       EventType = 546
	TypeSignalMapItem       EventType = 547

	TypeManageMaps       EventType = 551
	TypeManageCharacters EventType = 552
	TypeManageInventory  EventType = 553
	TypeManageItems      EventType = 554
	TypeManageCampaign   EventType = 555

	TypeChatBroadcast EventType = 800
	TypeChatServerMsg EventType = 801
	TypeChatCommand   EventType = 802
	TypeChatWhisper   EventType = 802
)

type RemoveMapItem

type RemoveMapItem struct {
	MapId     string `json:"MapId"`
	MapItemId string `json:"Id"`
}

type SendSignal

type SendSignal struct {
	Id   string `json:"Id"`
	X    string `json:"X"`
	Y    string `json:"Y"`
	Type string `json:"Type"`
	Html string `json:"Html"`
}

type SetActivity

type SetActivity struct {
	Id     string `json:"Id"`
	Active bool   `json:"Active"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL