Beamable SDK
Public Member Functions | Public Attributes | Protected Member Functions | Events | List of all members
Beamable.Player.PlayerItem Class Reference

An item in the player's inventory. The item is uniquely identified by the ContentId and ItemId as a pair. More...

Inheritance diagram for Beamable.Player.PlayerItem:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Player.PlayerItem:
Collaboration graph
[legend]

Public Member Functions

override bool Equals (object obj)
 
override int GetHashCode ()
 
override int GetBroadcastChecksum ()
 The broadcast checksum is a concept for change-detection. More...
 

Public Attributes

string ContentId
 The content id of ItemContent that this item is an instance of.
 
long ItemId
 The item instance id. This id is unique per player, but not across players.
 
long CreatedAt
 The epoch timestamp in milliseconds when the item was created.
 
long UpdatedAt
 The epoch timestamp in milliseconds when the item was last modified.
 
SerializableDictionaryStringToString Properties = new SerializableDictionaryStringToString()
 A set of instance level property data for the item.
 
ItemContent Content
 A reference to the top level ItemContent content. If the item is a sub type of the item content, then this can be cast to the accurate type.
 

Protected Member Functions

bool Equals (PlayerItem other)
 
- Protected Member Functions inherited from Beamable.Common.Player.DefaultObservable
void TriggerUpdate ()
 

Events

Action OnDeleted
 An event that will trigger when this item is removed from the player's inventory.
 
- Events inherited from Beamable.Common.Player.DefaultObservable
Action OnUpdated
 A "change" only happens when the value of the GetBroadcastChecksum changes.
 
- Events inherited from Beamable.Common.Player.IObservable
Action OnUpdated
 An event that happens whenever the object has changed.
 

Detailed Description

An item in the player's inventory. The item is uniquely identified by the ContentId and ItemId as a pair.

Use the Properties dictionary to store runtime instance data about a particular item.

Member Function Documentation

◆ GetBroadcastChecksum()

override int Beamable.Player.PlayerItem.GetBroadcastChecksum ( )
inlinevirtual

The broadcast checksum is a concept for change-detection.

An observable may have a complex data structure, and detecting changes can be very context specific. This method provides a way to compute some "hash" or "checksum" of the data. The "same" internal values should always produce the same output integer.

By default, the broadcast checksum will use the object's GetHashCode() implementation.

Returns
an checksum of the object state

Reimplemented from Beamable.Common.Player.DefaultObservable.


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