Table of Contents

Struct ResourceInfo

Namespace
ReFuel.Resources
Assembly
ReFuel.dll
[SystemData(typeof(ResourceSystem))]
public struct ResourceInfo : IResourceInfo, IArc, IDisposable, ISystemData<ResourceInfo, ResourceSystem>, ISystemData<ResourceInfo, ResourceSystem, ResourceInfo>, ISystemData<ResourceInfo, ResourceSystem, ResourceClass>, ISystemData
Implements
Inherited Members

Constructors

ResourceInfo(ResourceClass)

public ResourceInfo(ResourceClass cls)

Parameters

cls ResourceClass

Properties

Class

The class of this resource.

public readonly ResourceClass Class { get; }

Property Value

ResourceClass

FailReason

A string that tells why the resource loader failed, if not null.

public ResourceLoaderFailReason? FailReason { readonly get; set; }

Property Value

ResourceLoaderFailReason

IsFailed

True if the resource loader has failed.

public bool IsFailed { get; set; }

Property Value

bool

IsReady

True when the resource is ready.

public bool IsReady { get; set; }

Property Value

bool

KeepAlive

Any object marked Keep Alive is never collected.

public bool KeepAlive { readonly get; set; }

Property Value

bool

Owner

The entity that owns this data.

public WeakReference<Entity> Owner { readonly get; set; }

Property Value

WeakReference<Entity>

References

Number of references to this object.

public int References { get; }

Property Value

int

SizeInBytes

Approximate size of the object in bytes.

public long SizeInBytes { readonly get; set; }

Property Value

long

Remarks

Because C# doesn't provide a way for us to measure the size of reference trees, we have to make do with hand written approximations of the real memory usage. This memory usage counter is used to determine which cached resources are to be evicted.

System

A reference to the system owning this data.

public SystemBase System { readonly get; set; }

Property Value

SystemBase

Methods

DecrementReference()

Decrement the number of references to this object.

public void DecrementReference()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

IncrementReference()

Increment the number of references to this object.

public void IncrementReference()

Events

Disposing

public event HookHandler<IResourceInfo> Disposing

Event Type

HookHandler<IResourceInfo>

Failed

public event HookHandler<IResourceInfo> Failed

Event Type

HookHandler<IResourceInfo>

Loaded

public event HookHandler<IResourceInfo> Loaded

Event Type

HookHandler<IResourceInfo>