toJsonLd method

  1. @override
Map<String, dynamic> toJsonLd()
override

Serialize SchemaGame to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'Game',
      'characterAttribute':
          convertToJsonLd(characterAttribute, [SchemaThing]),
      'gameItem': convertToJsonLd(gameItem, [SchemaThing]),
      'gameLocation': convertToJsonLd(
          gameLocation, [SchemaPlace, SchemaPostalAddress, String]),
      'numberOfPlayers':
          convertToJsonLd(numberOfPlayers, [SchemaQuantitativeValue]),
      'quest': convertToJsonLd(quest, [SchemaThing]),
    });