Skip to content

Commit

Permalink
bump cardinal version again and add logger to system functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jerargus committed Aug 25, 2023
1 parent 6a2d2ca commit cb07942
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cardinal/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ require (
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
pkg.world.dev/world-engine/cardinal v0.1.26-alpha
pkg.world.dev/world-engine/cardinal v0.1.27-alpha
pkg.world.dev/world-engine/chain v0.1.11-alpha // indirect
pkg.world.dev/world-engine/sign v0.1.6-alpha // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cardinal/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,8 @@ nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
pgregory.net/rapid v1.0.0 h1:iQaM2w5PZ6xvt6x7hbd7tiDS+nk7YPp5uCaEba+T/F4=
pgregory.net/rapid v1.0.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
pkg.world.dev/world-engine/cardinal v0.1.26-alpha h1:EWoc83UZUXAWELTcuOMl2UeIwdDYY804Xjmv1bB24Ps=
pkg.world.dev/world-engine/cardinal v0.1.26-alpha/go.mod h1:Dtohz7ccdzyL6eLp2p0MrR++AtbXe4lmhmOTtnlwf6E=
pkg.world.dev/world-engine/cardinal v0.1.27-alpha h1:IchI/BfXd9OoxbI3WsTuKKVX1EtIUooLtq+k8NEFhMw=
pkg.world.dev/world-engine/cardinal v0.1.27-alpha/go.mod h1:Dtohz7ccdzyL6eLp2p0MrR++AtbXe4lmhmOTtnlwf6E=
pkg.world.dev/world-engine/chain v0.1.11-alpha h1:a+a+eZUIG2XuO+PL5WBr+IgQZoGRnm8plk5bP1KKoR4=
pkg.world.dev/world-engine/chain v0.1.11-alpha/go.mod h1:qpm1QXHj2RyXIiwkEolaZMMqeNVcMX+hH4OQ9nE0/5M=
pkg.world.dev/world-engine/sign v0.1.6-alpha h1:ZGHmsvx4QPo6odFPx2rc8n2KIAT1GTP/8gIopNGWpwA=
Expand Down
2 changes: 1 addition & 1 deletion cardinal/system/system_attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// AttackSystem is a system that inflict damage to player's HP based on `AttackPlayer` transactions.
// This provides a simple example of how to create a system that modifies the component of an entity.
func AttackSystem(world *ecs.World, tq *ecs.TransactionQueue) error {
func AttackSystem(world *ecs.World, tq *ecs.TransactionQueue, _ *ecs.Logger) error {
// Get all the transactions that are of type CreatePlayer from the tx queue
attackTxs := tx.AttackPlayer.In(tq)

Expand Down
2 changes: 1 addition & 1 deletion cardinal/system/system_player_spawner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// PlayerSpawnerSystem is a system that spawns players based on `CreatePlayer` transactions.
// This provides a simple example of how to create a system that creates a new entity.
func PlayerSpawnerSystem(world *ecs.World, tq *ecs.TransactionQueue) error {
func PlayerSpawnerSystem(world *ecs.World, tq *ecs.TransactionQueue, _ *ecs.Logger) error {
// Get all the transactions that are of type CreatePlayer from the tx queue
createTxs := tx.CreatePlayer.In(tq)

Expand Down
2 changes: 1 addition & 1 deletion cardinal/system/system_regen.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// RegenSystem is a system that replenishes the player's HP at every tick.
// This provides a simple example of how to create a system that doesn't rely on a transaction to update a component.
func RegenSystem(world *ecs.World, _ *ecs.TransactionQueue) error {
func RegenSystem(world *ecs.World, _ *ecs.TransactionQueue, _ *ecs.Logger) error {
ecs.NewQuery(filter.Exact(comp.Player, comp.Health)).Each(world, func(id storage.EntityID) bool {
// Get the health component for the player
health, err := comp.Health.Get(world, id)
Expand Down

0 comments on commit cb07942

Please sign in to comment.