Skip to content

Rework game events #7

Open
Open

Description

@wlwanpan

Rn we need to look at the implementation logparser.go to figure out what Data each event holds. Might be worth having concrete event struct per events:

type PlayerJoinedEvent struct {
  Name string
  Time time.Time
  ...
}

type PlayerSayEvent struct {
  Name string
  Message string
  ...
}

then on the receiver side:

ev := <-wpr.GameEvents()
if ev.Type == events.PlayerSayEvent {
  playerSayEv := ev.(events.PlayerSayEvent)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions