Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrActorDoesntExist = errors.New("actor doesn't exist")
View Source
var ErrActorExists = errors.New("actor already exists")
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { Name string // Actor's Unique ID Id rpg2d.ActorId // Location in the world Loc coord.Cell // Way the actor is facing Facing coord.Direction // Is Connected to the simulation IsConnected chan bool // contains filtered or unexported fields }
func (Actor) Authenticate ¶
Authenticate the credentials for an actor.
func (Actor) CanBeConnected ¶
Check if the actor can be connected.
type Datastore ¶
type Datastore interface { ActorExists(name string) (Actor, bool) // Can return ErrActorExists if the actor's name // already exists in the datastore. AddActor(name, password string) (Actor, error) // Update the actor that is stored. UpdateActor(Actor) error }
The behavior required to load information about the game world from a remote database.
func NewMemDatastore ¶
func NewMemDatastore() Datastore
An implementation of the Datastore interface that will store all the data in memory. Is safe for concurrency. Data will be lost if process closes.
Click to show internal directories.
Click to hide internal directories.