WorldSceneDetailsDictionary - jimdroberts/FishMMO GitHub Wiki

Description

Serializable dictionary mapping scene names to their configuration details. Used to store and access all world scene details for the game.


Basic Usage

Setup

  1. Use this class to store mappings from scene names (string) to WorldSceneDetails objects.
  2. Integrate this dictionary into your scene management or configuration systems as needed.

Example

// Example 1: Creating and populating a WorldSceneDetailsDictionary
WorldSceneDetailsDictionary sceneDict = new WorldSceneDetailsDictionary();
sceneDict["MainTown"] = new WorldSceneDetails {
    MaxClients = 100,
    // ...other configuration...
};

// Example 2: Accessing scene details
if (sceneDict.TryGetValue("MainTown", out WorldSceneDetails details)) {
    // Use details as needed
}

Best Practices

  • Use clear, unique scene names as keys to avoid conflicts.
  • Always check for key existence before accessing dictionary values.
  • Keep the dictionary updated to reflect the latest scene configurations.
  • Leverage the inherited methods from SerializableDictionary for safe access and manipulation.
⚠️ **GitHub.com Fallback** ⚠️