-
Notifications
You must be signed in to change notification settings - Fork 113
Upgrading Checklist 1.0.0
WIP
1.0.0 is a major release, with substantial changes to API. Porting is not exceptionally difficult. If you get stuck hop on gitter for help.
Before | After |
---|---|
Entity#getComponent(c) |
ComponentMapper#get(e) or ComponentMapper#getSafe(e[,fallback])
|
Entity#setComponent(c) |
ComponentMapper#create(e) or ComponentMapper#set(e,toggle)
|
Entity#removeComponent(c) |
ComponentMapper#remove(e) |
Entity#deleteFromWorld() |
world.delete(e) |
Entity#edit() |
world.edit(e) |
Entity#isEnabled() , Entity#enable() , Entity#disable()
|
see Migrate disabled entities below |
Entity#getUuid() |
See Migrate UUID below |
Flyweights are no more! API accepts both Entity as int parameters where applicable. Where needed you can obtain an entity reference via world#getEntity(id)
. Migrate to int
entity systems where performance is critical.
Before | After |
---|---|
World.createEntity(e) |
world.create() |
World.deleteEntity(e) |
world.delete(e) |
1.0.0 brings back entity references by popular request. You can now choose between entity references or entity int
identifiers. You can mix and match as required.
Sit closer to the metal. Significant performance benefit. Slightly more verbose. Use this if not certain.
Before | After |
---|---|
extends EntitySystem |
extends BaseEntitySystem |
extends EntityProcessingSystem |
extends IteratingSystem |
API accepts both Entity
as int
parameters where applicable.
Before (0.10+) | After |
---|---|
#inserted(int entityId) |
#inserted(Entity entity) |
#removed(int entityId) |
#removed(Entity entity) |
Managers have been merged with the System hierarchy. Register your managers with world#setSystem(manager)
.
Manager
is supported but discouraged. When possible, port any implementations to BaseEntitySystem
using
Aspect.all()
or BaseSystem
.
Manager#changed(int entityId)
is no longer available as it was rarely used. Let us know what you used it for!
UUID is supported but discouraged due to performance. UUID convenience methods have been removed from Entity
and World
. UuidEntityManager
remains. Interact with UUID via UuidEntityManager
, or replace with your own unique id solution.
Implement a Disabled
component and Aspect.exclude()
from relevant systems. Component Mappers provide easy control over component toggling.
Using Aspects makes entity behavior more predictable, more granular and easily serializable.
You can remove @Wire
from all your systems and managers, except for non-artemis dependencies. By convention, @Wire(injectInherited=true)
is now implied on all systems and managers. @SkipWire
to suppress, @Wire
to customize. Remove @Mapper
altogether.
Before | After |
---|---|
extends VoidEntitySystem |
extends BaseSystem |
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference