core / pragma.content / ContentData /

ContentData #

interface ContentData<ContentProto : GeneratedMessageV3>

Provides read access to a specific type of versioned content data.

Template class with the corresponding content proto.

Used by:

  • ContentHandler
  • ContentDataProxy

Parameters #

ContentProto

A type parameter - use the content proto class.

Functions #

NameSummary

getOrThrow

abstract fun getOrThrow(id: String): ContentProto

Throws a PragmaException if missing a content entry for this id

idFromProto

abstract fun idFromProto(proto: ContentProto): String

Implement idFromProto to define the proto field that represents the ID.

migratePlayer

abstract suspend fun migratePlayer(playerId: PlayerId, migratorFactory: MigratorFactory)

Called for live data migration.

tagsFromProto

abstract fun tagsFromProto(proto: ContentProto): List<String>

Implement tagsFromProto if the proto has a field for a list of tags.

validateExtWithAllContent

abstract fun validateExtWithAllContent(contentByType: Map<String, ContentData<*>>)

Implement validateExtWithAllContent to validate any cross-content nested IDs under nested ext protos.

validateIds

abstract fun validateIds(idsToValidate: Set<CorrespondingIds>, contentType: String)

Part of validation steps - checks that all IDs passed in are contained in this ContentData map.

validateWithAllContent

abstract fun validateWithAllContent(contentByType: Map<String, ContentData<*>>)

Implement validateWithAllContent to validate any cross-content nested IDs.

Inheritors #

Name

ContentHandler