View Source Upgrade Guide
0-4-to-0-5
0.4 to 0.5
Non-unique Component types are no longer allowed. Setting the :unique
option from within a Component
module now has no effect. If you are currently using non-unique Component types in your application,
you must replace them with Entities as described in the one_to_many guide.
Component read/write changes:
MyComponent.get_one/1
should be renamed toMyComponent.get/1
0-3-x-to-0-4
0.3.x to 0.4
In manager.ex
:
setup do
should be changed todef startup do
- Remove the
:tick_rate
option if it is set - If the
:tick_rate
option was not the default of 20, addconfig :ecsx, tick_rate: n
to yourconfig.exs
, where n is your chosen tick rate
In application.ex
:
- If the list of children in
start/2
containsECSx.ClientEvents
orYourApp.Manager
, remove them
Component read/write changes:
- Any use of
MyComponent.get_one(entity)
wherenil
was a possibility, should be replaced withMyComponent.get_one(entity, nil)
- Any use of
MyComponent.add(entity, value)
to update the value of a unique component, should be replaced withMyComponent.update(entity, value)
. If theadd/2
call was used in a way where sometimes it would create new components, and other times update those components, you will need to separate the two cases to useadd/2
only for the initial creation, and thenupdate/2
for all subsequent updates.