Search Results for

    Show / Hide Table of Contents

    Class ResourceManager

    Inheritance
    Object
    ResourceManager
    Implements
    IResourceManager
    IPreRunGameService
    Namespace: RTSEngine.ResourceExtension
    Assembly: cs.temp.dll.dll
    Syntax
    public class ResourceManager : MonoBehaviour, IResourceManager, IPreRunGameService

    Properties

    AllResources

    Declaration
    public IEnumerable<IResource> AllResources { get; }
    Property Value
    Type Description
    IEnumerable<IResource>

    FactionResources

    Declaration
    public IReadOnlyDictionary<int, IFactionSlotResourceManager> FactionResources { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<Int32, IFactionSlotResourceManager>

    gameMgr

    Declaration
    protected IGameManager gameMgr { get; }
    Property Value
    Type Description
    IGameManager

    globalEvent

    Declaration
    protected IGlobalEventPublisher globalEvent { get; }
    Property Value
    Type Description
    IGlobalEventPublisher

    inputMgr

    Declaration
    protected IInputManager inputMgr { get; }
    Property Value
    Type Description
    IInputManager

    logger

    Declaration
    protected IGameLoggingService logger { get; }
    Property Value
    Type Description
    IGameLoggingService

    MapResourceTypes

    Declaration
    public IReadOnlyList<ResourceTypeInfo> MapResourceTypes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<ResourceTypeInfo>

    Methods

    CreateResource(IResource, Vector3, Quaternion, InitResourceParameters)

    Declaration
    public ErrorMessage CreateResource(IResource resourcePrefab, Vector3 spawnPosition, Quaternion spawnRotation, InitResourceParameters initParams)
    Parameters
    Type Name Description
    IResource resourcePrefab
    Vector3 spawnPosition
    Quaternion spawnRotation
    InitResourceParameters initParams
    Returns
    Type Description
    ErrorMessage

    CreateResourceLocal(IResource, Vector3, Quaternion, InitResourceParameters)

    Declaration
    public IResource CreateResourceLocal(IResource resourcePrefab, Vector3 spawnPosition, Quaternion spawnRotation, InitResourceParameters initParams)
    Parameters
    Type Name Description
    IResource resourcePrefab
    Vector3 spawnPosition
    Quaternion spawnRotation
    InitResourceParameters initParams
    Returns
    Type Description
    IResource

    HasResources(ResourceInput, Int32)

    Declaration
    public bool HasResources(ResourceInput resourceInput, int factionID)
    Parameters
    Type Name Description
    ResourceInput resourceInput
    Int32 factionID
    Returns
    Type Description
    Boolean

    HasResources(IEnumerable<ResourceInput>, Int32)

    Declaration
    public bool HasResources(IEnumerable<ResourceInput> inputResources, int factionID)
    Parameters
    Type Name Description
    IEnumerable<ResourceInput> inputResources
    Int32 factionID
    Returns
    Type Description
    Boolean

    HasResources(IEnumerable<ResourceInputRange>, Int32)

    Declaration
    public bool HasResources(IEnumerable<ResourceInputRange> resourceInputArray, int factionID)
    Parameters
    Type Name Description
    IEnumerable<ResourceInputRange> resourceInputArray
    Int32 factionID
    Returns
    Type Description
    Boolean

    HasResourceTypeReachedLimitCapacity(ResourceTypeInfo, Int32)

    Declaration
    public bool HasResourceTypeReachedLimitCapacity(ResourceTypeInfo resourceType, int factionID)
    Parameters
    Type Name Description
    ResourceTypeInfo resourceType
    Int32 factionID
    Returns
    Type Description
    Boolean

    Init(IGameManager)

    Declaration
    public void Init(IGameManager gameMgr)
    Parameters
    Type Name Description
    IGameManager gameMgr

    IsResourceTypeValidInGame(ResourceInput, Int32)

    Declaration
    public bool IsResourceTypeValidInGame(ResourceInput resourceInput, int factionID)
    Parameters
    Type Name Description
    ResourceInput resourceInput
    Int32 factionID
    Returns
    Type Description
    Boolean

    IsResourceTypeValidInGame(ResourceTypeInfo)

    Declaration
    public bool IsResourceTypeValidInGame(ResourceTypeInfo resourceType)
    Parameters
    Type Name Description
    ResourceTypeInfo resourceType
    Returns
    Type Description
    Boolean

    IsResourceTypeValidInGame(ResourceTypeInfo, Int32)

    Declaration
    public bool IsResourceTypeValidInGame(ResourceTypeInfo resourceType, int factionID)
    Parameters
    Type Name Description
    ResourceTypeInfo resourceType
    Int32 factionID
    Returns
    Type Description
    Boolean

    ReleaseResources(IEnumerable<ResourceInput>, Int32)

    Declaration
    public void ReleaseResources(IEnumerable<ResourceInput> inputResources, int factionID)
    Parameters
    Type Name Description
    IEnumerable<ResourceInput> inputResources
    Int32 factionID

    SetReserveResources(ResourceInput, Int32)

    Declaration
    public void SetReserveResources(ResourceInput resourceInput, int factionID)
    Parameters
    Type Name Description
    ResourceInput resourceInput
    Int32 factionID

    SetReserveResources(IEnumerable<ResourceInput>, Int32)

    Declaration
    public void SetReserveResources(IEnumerable<ResourceInput> inputResources, int factionID)
    Parameters
    Type Name Description
    IEnumerable<ResourceInput> inputResources
    Int32 factionID

    SetResource(Int32, ResourceInput)

    Declaration
    public void SetResource(int factionID, ResourceInput resourceInput)
    Parameters
    Type Name Description
    Int32 factionID
    ResourceInput resourceInput

    SetResource(Int32, IEnumerable<ResourceInput>)

    Declaration
    public void SetResource(int factionID, IEnumerable<ResourceInput> resourceInputArray)
    Parameters
    Type Name Description
    Int32 factionID
    IEnumerable<ResourceInput> resourceInputArray

    TryGetResourceTypeWithKey(String, out ResourceTypeInfo)

    Declaration
    public bool TryGetResourceTypeWithKey(string key, out ResourceTypeInfo resourceType)
    Parameters
    Type Name Description
    String key
    ResourceTypeInfo resourceType
    Returns
    Type Description
    Boolean

    UpdateReserveResources(ResourceInput, Int32)

    Declaration
    public void UpdateReserveResources(ResourceInput resourceInput, int factionID)
    Parameters
    Type Name Description
    ResourceInput resourceInput
    Int32 factionID

    UpdateReserveResources(IEnumerable<ResourceInput>, Int32)

    Declaration
    public void UpdateReserveResources(IEnumerable<ResourceInput> inputResources, int factionID)
    Parameters
    Type Name Description
    IEnumerable<ResourceInput> inputResources
    Int32 factionID

    UpdateResource(Int32, ResourceInput, Boolean)

    Adds/removes an amount of a faction's resource. If the resource type capacity is a limited based capacity resource and there is a rest amount that can not be added due to reaching maximum capacity, it will not be reported by this method.

    Declaration
    public void UpdateResource(int factionID, ResourceInput resourceInput, bool add)
    Parameters
    Type Name Description
    Int32 factionID

    ID of the faction whose resources will be updated.

    ResourceInput resourceInput

    Defines the resource type and amount to add/remove.

    Boolean add

    Adds the resources when true, otherwise removes the resources from the faction.

    UpdateResource(Int32, ResourceInput, Boolean, out Int32)

    Adds/removes an amount of a faction's resource.

    Declaration
    public void UpdateResource(int factionID, ResourceInput resourceInput, bool add, out int restAmount)
    Parameters
    Type Name Description
    Int32 factionID

    ID of the faction whose resources will be updated.

    ResourceInput resourceInput

    Defines the resource type and amount to add/remove.

    Boolean add

    Adds the resources when true, otherwise removes the resources from the faction.

    Int32 restAmount

    In case of a capacity type resource with limit based capacity, this returns the amount that can not be added due to reaching maximum capacity, if that maximum capacity is ever reached.

    UpdateResource(Int32, IEnumerable<ResourceInput>, Boolean)

    Adds/removes an amount of a faction's resource. If the one of the resource types has a limited based capacity resource and there is a rest amount that can not be added due to reaching maximum capacity, it will not be reported by this method.

    Declaration
    public void UpdateResource(int factionID, IEnumerable<ResourceInput> resourceInputArray, bool add)
    Parameters
    Type Name Description
    Int32 factionID

    ID of the faction whose resources will be updated.

    IEnumerable<ResourceInput> resourceInputArray

    Array where each element defines a resource type and the amount to add/remove.

    Boolean add

    Adds the resources when true, otherwise removes the resources from the faction.

    Implements

    IResourceManager
    IPreRunGameService
    In This Article
    Back to top Unity RTS Engine Documentation