-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: world engine v1.0 #26
Conversation
cardinal/main.go
Outdated
|
||
err = world.StartGame() | ||
Must(world.StartGame()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "world" here is a *cardinal.World, and the "world" below is a cardinal.WorldContext. I think duplicating the name could cause confusion. I'd suggest using worldCtx
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed this to w
instead. i really would prefer to preserve world
in system because that is the least ugly
d94e3f2
to
e5b9676
Compare
for i, create := range createTxs { | ||
id, err := cardinal.Create(wCtx, comp.PlayerComponent{}, comp.HealthComponent{}) | ||
id, err := cardinal.Create(world, comp.Player{}, comp.Health{}) | ||
if err != nil { | ||
tx.CreatePlayer.AddError(wCtx, create.Hash(), | ||
tx.CreatePlayer.AddError(world, create.Hash(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should update either in this PR or a follow up, using the iterators.
e5b9676
to
f5cb06a
Compare
type WorldVarsKey string | ||
|
||
const ( | ||
PlayerCount = WorldVarsKey("playerCount") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PlayersCount
is only used in this file, so the addition of the WorldVarsKey
type seems unnecessary.
was this key supposed to be used somewhere else in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, will fix that.
docker-compose.yml
Outdated
@@ -35,7 +35,7 @@ services: | |||
- "9601:9601" | |||
- "8545:8545" | |||
|
|||
cockroachdb: | |||
postgres: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intended?
@smsunarto I attempted to run this branch using the updated Docker Compose configuration I suggested earlier. |
you need to run it with World CLI that will inject the world.toml into env var. otherwise it will error because the namespace is not set |
Co-authored-by: Heronimus Adie <[email protected]>
Overview
WorldContext
arg name should beworld
instead ofwCtx
for better readability....Component
. For ex:HealthComponent
->Health
Must
function in main.go to reduce err != nil stuff