Captainup  2.4
Instance Methods | Properties | List of all members
<CPTAsset> Protocol Reference

#import <CPTAsset.h>

Inheritance diagram for <CPTAsset>:
<CPTObject>

Instance Methods

(nullable id< CPTReward >) - getReward
 
(BOOL) - hasReward
 
(BOOL) - isSegmentedForUser:
 
- Instance Methods inherited from <CPTObject>
(nonnull instancetype) - initWithDictionary:
 
(nonnull NSDictionary< NSString *, id > *) - toDictionary
 

Properties

NSString * assetId
 
CPTAssetType type
 
NSString * name
 
NSString * assetDescription
 
BOOL isActive
 
NSArray< NSString * > * acquireOn
 
NSUInteger weight
 
NSUInteger stock
 
NSString * presetImage
 
NSDate * createdAt
 
NSDate * updatedAt
 
NSString * descriptionHtml
 
NSDictionary< NSString *, NSNumber * > * currencies
 
id< CPTImageFilesimageFiles
 
BOOL isUnlimitedStock
 
BOOL isSegmented
 
NSArray< id< CPTReward > > * rewards
 
- Properties inherited from <CPTObject>
NSDictionary< NSString *, id > * sourceDictionary
 

Detailed Description

An asset object, can be used as a Shop Item {

See also
getType()}, to track a player's progress on an asset check the corresponding AcquiredAsset object that is stored in the player object

Method Documentation

◆ getReward()

- (nullable id<CPTReward>) getReward

The Asset Reward Object

Returns
a CPTReward Object or Null if there is no reward for this asset

◆ hasReward()

- (BOOL) hasReward

Does the asset has a reward object attached to it

Returns
a BOOL true if the asset has a reward object or false if reward object is null

◆ isSegmentedForUser:()

- (BOOL) isSegmentedForUser: (nonnull id< CPTUser >)  user

Use this function to know if a asset should be displayed for your specific user For example: asset.isSegmentedForUser(CaptainUp.getLoggedInUser())

Parameters
useruser object
Returns
true if the asset is segmented to the provided user, false otherwise.

Property Documentation

◆ acquireOn

- (NSArray<NSString*>*) acquireOn
readnonatomicassign

asset acquired on list

◆ assetDescription

- (NSString*) assetDescription
readnonatomicassign

asset description

◆ assetId

- (NSString*) assetId
readnonatomicassign

The ID of the asset

◆ createdAt

- (NSDate*) createdAt
readnonatomicassign

Description

◆ currencies

- (NSDictionary<NSString*,NSNumber*>*) currencies
readnonatomicassign

Description

◆ descriptionHtml

- (NSString*) descriptionHtml
readnonatomicassign

Description

◆ imageFiles

- (id<CPTImageFiles>) imageFiles
readnonatomicassign

Description

◆ isActive

- (BOOL) isActive
readnonatomicassign

is asset active

◆ isSegmented

- (BOOL) isSegmented
readnonatomicassign

Asset segmentation allows you to filter the asset presentation according to different user attributes. For example - you can add a "market" filter so only users in this specific market can see the asset.

◆ isUnlimitedStock

- (BOOL) isUnlimitedStock
readnonatomicassign

Description

◆ name

- (NSString*) name
readnonatomicassign

asset name

◆ presetImage

- (NSString*) presetImage
readnonatomicassign

Description

◆ rewards

- (NSArray<id<CPTReward> >*) rewards
readnonatomicassign

The Asset Rewards Array

Returns
a NSArray<CPTReward> NSArray or Null if there is no reward for this asset

◆ stock

- (NSUInteger) stock
readnonatomicassign

asset stock

◆ type

- (CPTAssetType) type
readnonatomicassign

asset type

◆ updatedAt

- (NSDate*) updatedAt
readnonatomicassign

Description

◆ weight

- (NSUInteger) weight
readnonatomicassign

asset weight


The documentation for this protocol was generated from the following file: