Skip to content

Commit

Permalink
release 0.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Apr 25, 2020
1 parent 6a94399 commit 7f5954a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
9 changes: 9 additions & 0 deletions documentation/RELEASENOTE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## DefaultEcs 0.14.1
removed restriction on ManagedResource TResource to be IDisposable

added AResourceManager.Unload to give the possibility to override the unload action for a resource

fixed Entity.Set overriding shared component value

[nuget package](https://www.nuget.org/packages/DefaultEcs/0.14.2)

## DefaultEcs 0.14.1
fixed Entity.ReadAllComponents accessing previous value component used by map

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs.Resource](./DefaultEcs-Resource.md 'DefaultEcs.Resource').[AResourceManager<TInfo,TResource>](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md 'DefaultEcs.Resource.AResourceManager<TInfo,TResource>')
## AResourceManager<TInfo,TResource>.Dispose() Method
Disposes all loaded resources.
Unloads all loaded resources.
```csharp
public void Dispose();
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#### [DefaultEcs](./index.md 'index')
### [DefaultEcs.Resource](./DefaultEcs-Resource.md 'DefaultEcs.Resource').[AResourceManager<TInfo,TResource>](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md 'DefaultEcs.Resource.AResourceManager<TInfo,TResource>')
## AResourceManager<TInfo,TResource>.Unload(TInfo, TResource) Method
Unloads a resource once it is no longer referenced by a [ManagedResource<TInfo,TResource>](./DefaultEcs-Resource-ManagedResource-TInfo_TResource-.md 'DefaultEcs.Resource.ManagedResource<TInfo,TResource>').
By default if [TResource](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager<TInfo,TResource>.TResource') is [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), calls the [System.IDisposable.Dispose](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') method.
```csharp
protected virtual void Unload(TInfo info, TResource resource);
```
#### Parameters
<a name='DefaultEcs-Resource-AResourceManager-TInfo_TResource--Unload(TInfo_TResource)-info'></a>
`info` [TInfo](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TInfo 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TInfo')
The [TInfo](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TInfo 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TInfo') that was used to load the resource.

<a name='DefaultEcs-Resource-AResourceManager-TInfo_TResource--Unload(TInfo_TResource)-resource'></a>
`resource` [TResource](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource')
The [TResource](./DefaultEcs-Resource-AResourceManager-TInfo_TResource-.md#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') to unload.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## AResourceManager&lt;TInfo,TResource&gt; Class
Base type used to load resources of type [TResource](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') using info of type [TInfo](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TInfo 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TInfo').
[TInfo](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TInfo 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TInfo') is used as key if the same resource is requested on multiple [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') to only load the [TResource](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') resource once.
If no [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') contains the [ManagedResource&lt;TInfo,TResource&gt;](./DefaultEcs-Resource-ManagedResource-TInfo_TResource-.md 'DefaultEcs.Resource.ManagedResource&lt;TInfo,TResource&gt;') component identifying the resource anymore, the [TResource](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') instance is then disposed automatically.
If no [Entity](./DefaultEcs-Entity.md 'DefaultEcs.Entity') contains the [ManagedResource&lt;TInfo,TResource&gt;](./DefaultEcs-Resource-ManagedResource-TInfo_TResource-.md 'DefaultEcs.Resource.ManagedResource&lt;TInfo,TResource&gt;') component identifying the resource anymore, the [TResource](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') instance is then unloaded automatically.
By default, if [TResource](#DefaultEcs-Resource-AResourceManager-TInfo_TResource--TResource 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.TResource') is [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [Unload(TInfo, TResource)](./DefaultEcs-Resource-AResourceManager-TInfo_TResource--Unload(TInfo_TResource).md 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.Unload(TInfo, TResource)') will call the [System.IDisposable.Dispose](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') method of the resource.
```csharp
public abstract class AResourceManager<TInfo,TResource> :
IDisposable
Expand All @@ -27,3 +28,4 @@ The type of the resource.
- [Load(TInfo)](./DefaultEcs-Resource-AResourceManager-TInfo_TResource--Load(TInfo).md 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.Load(TInfo)')
- [Manage(DefaultEcs.World)](./DefaultEcs-Resource-AResourceManager-TInfo_TResource--Manage(DefaultEcs-World).md 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.Manage(DefaultEcs.World)')
- [OnResourceLoaded(DefaultEcs.Entity, TInfo, TResource)](./DefaultEcs-Resource-AResourceManager-TInfo_TResource--OnResourceLoaded(DefaultEcs-Entity_TInfo_TResource).md 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.OnResourceLoaded(DefaultEcs.Entity, TInfo, TResource)')
- [Unload(TInfo, TResource)](./DefaultEcs-Resource-AResourceManager-TInfo_TResource--Unload(TInfo_TResource).md 'DefaultEcs.Resource.AResourceManager&lt;TInfo,TResource&gt;.Unload(TInfo, TResource)')
2 changes: 1 addition & 1 deletion source/DefaultEcs/DefaultEcs.Release.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DefaultDocumentationFolder>..\..\documentation\api</DefaultDocumentationFolder>
</PropertyGroup>
<ItemGroup Label="Documentation" Condition="'$(TargetFramework)'=='netstandard1.1'">
<PackageReference Include="DefaultDocumentation" Version="0.6.1" PrivateAssets="all" />
<PackageReference Include="DefaultDocumentation" Version="0.6.2" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup Label="Package">
Expand Down

0 comments on commit 7f5954a

Please sign in to comment.