Skip to content

Game.PdxLoginRequirement

Assembly: Game
Namespace: Game.Prefabs

Type: class

Base: ContentRequirementBase

Summary:
Requirement component used by content prefabs to require that the user has logged into a Paradox (Pdx) account. Placed in the Component menu at "Prefabs/Content/". The requirement checks the game's PdxSdk platform (named "PdxSdk") and returns true only if that platform reports the user has ever logged in. If the PdxSdk platform is not available the requirement evaluates to false.


Fields

  • This class declares no instance or static fields of its own. All state is determined at runtime via PlatformManager calls or inherited members from ContentRequirementBase.

Properties

  • This class declares no properties.

Constructors

  • public PdxLoginRequirement()
    Default parameterless constructor (implicit if not declared). Instances are typically created by the prefab/component system rather than manually constructed.

Methods

  • public override string GetDebugString()
    Returns a short debugging string identifying this requirement. Implementation returns the literal "Paradox Account Login".

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Intentionally empty. This requirement does not add any ECS component types to a prefab.

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    Intentionally empty. This requirement does not add any ECS component types to an archetype.

  • public override bool CheckRequirement()
    Performs the actual requirement check. Implementation: PlatformManager.instance.GetPSI("PdxSdk")?.hasEverLoggedIn ?? false

This retrieves the PdxSdkPlatform instance registered under the name "PdxSdk" (via PlatformManager.GetPSI), then checks its hasEverLoggedIn flag. If the platform instance is not present (null) the null-conditional and null-coalescing operators cause the method to return false. In short: returns true only if the PdxSdk platform exists and reports the user has ever logged in.

Usage Example

// Example: runtime check
var requirement = new PdxLoginRequirement();
bool satisfied = requirement.CheckRequirement();
UnityEngine.Debug.Log($"Paradox account login requirement satisfied: {satisfied}");

Notes: - This component is intended to be attached to prefabs (see the [ComponentMenu("Prefabs/Content/")] attribute in source). The prefab/content system will typically instantiate and evaluate the requirement rather than creating it manually. - The check depends on the PdxSdk platform being registered under the name "PdxSdk" with PlatformManager; if that platform or its hasEverLoggedIn property is unavailable, the requirement evaluates to false.