decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil
MIT License
4 stars 1 forks source link

Adding ReadOnly interface #195

Closed jkeon closed 1 year ago

jkeon commented 1 year ago

Adding the ability to interface with an AccessControlledValue as an IReadOnlyAccessControlledValue. Also allowing TaskDrivers to use the interfaces for requiring generic data.

What is the current behaviour?

You'd have to manually restrict access to an AccessControlledValue. TaskDrivers would require the concrete type to be added as generic data.

What is the new behaviour?

You can now just return the interface to restrict the type.

IAccessControlledValue allows for you to specify the AccessType and works the same as the concrete type. IReadOnlyAccessControlledValue gives only read only access.

TaskDrivers will accept either interfaces, or the concrete type when RequireGenericDataForRead but will only accept IAccessControlledValue when RequireGenericDataForWrite or RequireGenericDataForExclusiveWrite. You cannot pass an IReadOnlyAccessControlledValue in.

What issues does this resolve?

What PRs does this depend on?

Does this introduce a breaking change?

jkeon commented 1 year ago

This was actually merged but github isn't working properly today.