Skip to content

Rework game events #7

@wlwanpan

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)
}

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