GetClan

From Intrigues Wiki
Revision as of 12:15, 5 January 2024 by Tayfunwiki (talk | contribs) (Created page with "=== IM Class - <code>GetClan</code> Method === ==== Overview ==== The <code>GetClan</code> method in the IM class is used to retrieve a clan within the game based on its name or ID. ==== Syntax ==== <syntaxhighlight lang="c#"> public static Clan GetClan(string clanNameOrID); </syntaxhighlight> ==== Description ==== This method searches for a clan in the game's active clan list using either the clan's name or its unique ID. If a match is found, it returns the correspon...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

IM Class - GetClan Method

Overview

The GetClan method in the IM class is used to retrieve a clan within the game based on its name or ID.

Syntax

public static Clan GetClan(string clanNameOrID);

Description

This method searches for a clan in the game's active clan list using either the clan's name or its unique ID. If a match is found, it returns the corresponding Clan object.

Example of Usage

public class ClanInfoDisplay : MonoBehaviour {
    void DisplayClanInfo() {
        // Retrieve a clan by name or ID
        var clan = IM.GetClan("Arcanum");

        // Check if the clan exists and display information
        if (clan != null) {
            Debug.Log($"Clan Name: {clan.ClanName}");
            Debug.Log($"Clan Description: {clan.Description}");
        } else {
            Debug.Log("Clan not found.");
        }
    }
}

Remarks

  • This method is particularly useful for accessing clan information dynamically, such as in scenarios where the player interacts with various clans, or when clan information needs to be displayed or updated.
  • It's important to ensure that the clan name or ID provided to the method matches exactly with those in the game's clan list for accurate retrieval.