WorldSceneDetailsDictionary - jimdroberts/FishMMO GitHub Wiki
Serializable dictionary mapping scene names to their configuration details. Used to store and access all world scene details for the game.
- Use this class to store mappings from scene names (string) to
WorldSceneDetails
objects. - Integrate this dictionary into your scene management or configuration systems as needed.
// 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
}
- 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.