@acceleratxr/core_sdk / Resource
Class: Resource#
Describes an single resource type of the virtual economy.
author Jean-Philippe Steinmetz info@acceleratxr.com
Hierarchy#
-
↳ Resource
Index#
Constructors#
Properties#
Accessors#
Constructors#
constructor#
+ new Resource(other?: any): Resource
Overrides EntityBase.constructor
Defined in src/models/Resource.ts:60
Parameters:#
Name |
Type |
|---|---|
|
any |
Returns: Resource
Properties#
cost#
• cost: Array<ResourceCost> = []
Defined in src/models/Resource.ts:25
The costs associated with the resource
data#
• data: any = undefined
Defined in src/models/Resource.ts:30
An arbitrary map of additional data about the resource.
dateCreated#
• dateCreated: Date = new Date()
Inherited from EntityBase.dateCreated
Defined in src/EntityBase.ts:18
The date and time that the object was created.
dateModified#
• dateModified: Date = new Date()
Inherited from EntityBase.dateModified
Defined in src/EntityBase.ts:23
The date and time that the object was last modified.
defaults#
• Optional defaults: ResourceDefaults = new ResourceDefaults()
Defined in src/models/Resource.ts:35
The defaults to use when creating new instances of the resource.
description#
• description: string = “”
Defined in src/models/Resource.ts:40
Description of the resource
name#
• name: string = “”
Defined in src/models/Resource.ts:20
The unique name of the resource.
parentUid#
• parentUid: string = “”
Defined in src/models/Resource.ts:45
The UUID of the parent resource to inherit stats, description, etc
stackable#
• stackable: boolean = false
Defined in src/models/Resource.ts:50
Indicates if the resource can be copied and stacked or if each instance is considered unique.
stats#
• stats: Array<Statistic> = []
Defined in src/models/Resource.ts:55
The list of stat definitions for the resource.
title#
• title: string = “”
Defined in src/models/Resource.ts:60
The name to display to the user.
uid#
• uid: string = uuid.v4()
Inherited from EntityBase.uid
Defined in src/EntityBase.ts:13
The universally unique identifier of the object.
version#
• version: number = 0
Inherited from EntityBase.version
Defined in src/EntityBase.ts:28
The optimistic locking version of the object.
Accessors#
ClassName#
• Staticget ClassName(): string
Defined in src/models/Resource.ts:15
Returns: string