GetClan

From Intrigues Wiki

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.