Previous: , Up: Resource Management   [Contents][Index]


14.2 Resource Receiver

Component: ResourceReceiver

This component allows both collection and expenditure of resources. If you are spending resources (value is less than 0) and you have enough, the resources will be spent and the ’Messages’ will be called. Likewise, if you are receiving resources, the messages will also be called. ’Resource Index’ refers to the specific resource we are spending or receiving. Values start at 0, meaning the first resource is 0 the second is 1 and so on. —-Messages:— ’Collect’ takes no parameter, and will send all ’Messages’ in the list when ’Resource Value’ is positive, or we have enough to cover the cost if negative. ’CollectSpecific’ takes a Floating Point parameter, indicating the gain (or cost, if negative) and otherwise executing ’Collect’ normally.

Field of ResourceReceiver: float periodicResourceTimer

If this is greater than zero, it represents a delay between automatic collections. Make it less than or equal to zero to turn it off.

Default value: 0

Field of ResourceReceiver: List<MessageManager.ManagedMessage> messages

These messages will be sent when we collect the resource. Or, if we are spending resources they will be sent only if we had enough to spend.

Default value: new List<MessageManager.ManagedMessage>()

Available Messages

Message on ResourceReceiver: Collect ()

Collects the ’Resource Value’ of this Resource Receiver

Message on ResourceReceiver: CollectSpecific ()

Collects a specific amount of the resource of this Resource Receiver

Field of ResourceReceiver: float periodicResourceTimer

If this is greater than zero, it represents a delay between automatic collections. Make it less than or equal to zero to turn it off.

Default value: 0

Field of ResourceReceiver: List<MessageManager.ManagedMessage> messages

These messages will be sent when we collect the resource. Or, if we are spending resources they will be sent only if we had enough to spend.

Default value: new List<MessageManager.ManagedMessage>()

Available Messages

Message on ResourceReceiver: Collect ()

Collects the ’Resource Value’ of this Resource Receiver

Message on ResourceReceiver: CollectSpecific ()

Collects a specific amount of the resource of this Resource Receiver


Previous: , Up: Resource Management   [Contents][Index]