Skip to content

Commit

Permalink
handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Nov 9, 2023
1 parent 9aff65a commit b4c91e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cardinal/ecs/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,20 @@ func (w *World) GetTxQueueAmount() int {
return w.txQueue.GetAmountOfTxs()
}

func (w *World) RegisterSystem(s System) {
w.RegisterSystemWithName(s, "")
func (w *World) RegisterSystem(s System) error {
if err := w.RegisterSystemWithName(s, ""); err != nil {
return err
}
return nil
}

func (w *World) RegisterSystems(systems ...System) {
func (w *World) RegisterSystems(systems ...System) error {
for _, system := range systems {
w.RegisterSystemWithName(system, "")
if err := w.RegisterSystemWithName(system, ""); err != nil {
return err
}
}
return nil
}

func (w *World) RegisterSystemWithName(system System, functionName string) error {
Expand Down

0 comments on commit b4c91e5

Please sign in to comment.