:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/GKChallenge.xml. .. _class_GKChallenge: GKChallenge =========== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`GKAchievementChallenge`, :ref:`GKScoreChallenge` Represents a Game Center challenge sent between players. .. rst-class:: classref-introduction-group Description ----------- Base wrapper for challenge objects delivered by Game Center. Use :ref:`load_received_challenges()` to fetch outstanding challenges for the local player, inspect :ref:`state` and :ref:`challenge_type`, and cast to :ref:`GKScoreChallenge` or :ref:`GKAchievementChallenge` when you need type-specific data. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`challenge_type` | ``2`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`completion_date` | ``0.0`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`issue_date` | ``0.0`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`GKPlayer` | :ref:`issuing_player` | ``null`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`String` | :ref:`message` | ``""`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`GKPlayer` | :ref:`receiving_player` | ``null`` | +---------------------------------+----------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`state` | ``0`` | +---------------------------------+----------------------------------------------------------------------+----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`decline`\ (\ ) | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`load_received_challenges`\ (\ callback\: :ref:`Callable`\ ) |static| | +--------+-----------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_GKChallenge_ChallengeState: .. rst-class:: classref-enumeration enum **ChallengeState**: :ref:`🔗` .. _class_GKChallenge_constant_INVALID: .. rst-class:: classref-enumeration-constant :ref:`ChallengeState` **INVALID** = ``0`` The challenge is invalid or no longer available. .. _class_GKChallenge_constant_PENDING: .. rst-class:: classref-enumeration-constant :ref:`ChallengeState` **PENDING** = ``1`` The challenge has been issued and is waiting for completion. .. _class_GKChallenge_constant_COMPLETED: .. rst-class:: classref-enumeration-constant :ref:`ChallengeState` **COMPLETED** = ``2`` The receiving player completed the challenge. .. _class_GKChallenge_constant_DECLINED: .. rst-class:: classref-enumeration-constant :ref:`ChallengeState` **DECLINED** = ``3`` The receiving player declined the challenge. .. rst-class:: classref-item-separator ---- .. _enum_GKChallenge_ChallengeType: .. rst-class:: classref-enumeration enum **ChallengeType**: :ref:`🔗` .. _class_GKChallenge_constant_SCORE: .. rst-class:: classref-enumeration-constant :ref:`ChallengeType` **SCORE** = ``0`` A score-based challenge backed by ``GKScoreChallenge``. .. _class_GKChallenge_constant_ACHIEVEMENT: .. rst-class:: classref-enumeration-constant :ref:`ChallengeType` **ACHIEVEMENT** = ``1`` An achievement-based challenge backed by ``GKAchievementChallenge``. .. _class_GKChallenge_constant_UNKNOWN: .. rst-class:: classref-enumeration-constant :ref:`ChallengeType` **UNKNOWN** = ``2`` A challenge payload type that this wrapper does not recognize. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GKChallenge_property_challenge_type: .. rst-class:: classref-property :ref:`int` **challenge_type** = ``2`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`int` **get_challenge_type**\ (\ ) The challenge payload type. See :ref:`ChallengeType`. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_completion_date: .. rst-class:: classref-property :ref:`float` **completion_date** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`float` **get_completion_date**\ (\ ) Unix timestamp (seconds) when the challenge was completed, or ``0`` if incomplete. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_issue_date: .. rst-class:: classref-property :ref:`float` **issue_date** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`float` **get_issue_date**\ (\ ) Unix timestamp (seconds) when the challenge was issued. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_issuing_player: .. rst-class:: classref-property :ref:`GKPlayer` **issuing_player** = ``null`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`GKPlayer` **get_issuing_player**\ (\ ) The player who issued this challenge. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_message: .. rst-class:: classref-property :ref:`String` **message** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_message**\ (\ ) Optional challenge message from the issuing player. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_receiving_player: .. rst-class:: classref-property :ref:`GKPlayer` **receiving_player** = ``null`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`GKPlayer` **get_receiving_player**\ (\ ) The player who received this challenge. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_property_state: .. rst-class:: classref-property :ref:`int` **state** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`int` **get_state**\ (\ ) The current lifecycle state. See :ref:`ChallengeState`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GKChallenge_method_decline: .. rst-class:: classref-method |void| **decline**\ (\ ) :ref:`🔗` Declines this challenge. .. rst-class:: classref-item-separator ---- .. _class_GKChallenge_method_load_received_challenges: .. rst-class:: classref-method |void| **load_received_challenges**\ (\ callback\: :ref:`Callable`\ ) |static| :ref:`🔗` Loads the challenges currently received by the local player. The callback receives ``(Array[GKChallenge] challenges, Variant error)``. If ``error`` is not null, it contains a ``GKError``. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`