Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Apr 4, 2023
1 parent 264e60d commit 59384ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Overseer"
uuid = "1ada24be-c16d-4464-9f61-27c2e0f16645"
authors = ["louisponet <[email protected]>"]
version = "0.2.7"
version = "0.2.8"

[deps]
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Expand Down
9 changes: 5 additions & 4 deletions src/entity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ function Entity(m::AbstractLedger, datas...)
return e
end

function entity(c::AbstractComponent, i::Integer)
return Entity(c.indices.packed[i])
end

function Entity(m::AbstractLedger, parent::Entity, datas...)
e = Entity(m)
for d in datas
Expand Down Expand Up @@ -186,3 +182,8 @@ end
return @inbounds i.components[state][i.e], state + 1
end
@inline Base.@propagate_inbounds Base.getindex(e::EntityState, i::Int) = e.components[i][e.e]

function entity(c::AbstractComponent, i::Integer)
return EntityState(Entity(c.indices.packed[i]), c)
end

2 changes: 1 addition & 1 deletion src/ledger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ stage(m::AbstractLedger, name) = stage(ledger(m), name)
valid_entities(m::AbstractLedger) = filter(x -> x.id != 0, entities(m))
stages(m::AbstractLedger) = ledger(m).stages
groups(m::AbstractLedger) = ledger(m).groups
singleton(m::AbstractLedger, ::Type{T}) where {T} = EntityState(entity(m[T], 1), m[T])
singleton(m::AbstractLedger, ::Type{T}) where {T} = EntityState(Entity(entity(m[T], 1)), m[T])

##### BASE Extensions ####
function Base.show(io::IO, ::MIME"text/plain", l::AbstractLedger)
Expand Down

2 comments on commit 59384ff

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/80990

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.8 -m "<description of version>" 59384ff7f543a43d60cd06916376677bd6f9f38e
git push origin v0.2.8

Please sign in to comment.