### Declaring Public API Methods - C# Source: https://github.com/kabooma/s1api/blob/stable/CODING_STANDARDS.md Provides an example of a public method intended for the modder-facing API. This snippet adheres to the standard requiring `public` access modifiers for all components exposed to modders, ensuring clarity and intended use. ```C# public static string GenerateString(int length) { ... } ``` -------------------------------- ### Applying Naming Conventions - C# Source: https://github.com/kabooma/s1api/blob/stable/CODING_STANDARDS.md Demonstrates the specified naming conventions: `_camelCase` for private fields and `PascalCase` for public methods and other public members, ensuring consistency across the codebase as per Jetbrains Rider suggestions. ```C# private int _myInteger; public float AddFloats(float floatOne, float floatTwo) => ... ``` -------------------------------- ### Adding Documentation Summaries - C# Source: https://github.com/kabooma/s1api/blob/stable/CODING_STANDARDS.md Illustrates the requirement for adding XML documentation comments, specifically a `` tag, to all modder-facing API declarations. This ensures that the purpose of public members is clearly documented for users (modders). ```C# /// /// Destroys all game objects in the world. /// public void DestroyGameWorld() { ... } ``` -------------------------------- ### Defining Custom Phone App Class (C#) Source: https://github.com/kabooma/s1api/blob/stable/S1API/PhoneApp/readme.md Shows how to create a custom phone application class by inheriting from `S1API.PhoneApp`. It demonstrates overriding properties for app metadata (name, title, icon) and implementing the `OnCreated` method to build the application's user interface using the `UIFactory`. ```C# using UnityEngine; using UnityEngine.UI; using S1API.PhoneApp; public class MyAwesomeApp : PhoneApp { protected override string AppName => "MyAwesomeApp"; protected override string AppTitle => "My Awesome App"; protected override string IconLabel => "Awesome"; protected override string IconFileName => "my_icon.png"; protected override void OnCreated(GameObject container) { GameObject panel = UIFactory.Panel("MainPanel", container.transform, Color.black); UIFactory.Text("HelloText", "📱 Hello from MyAwesomeApp!", panel.transform, 22, TextAnchor.MiddleCenter, FontStyle.Bold); } } ``` -------------------------------- ### Registering Custom Phone App (C#) Source: https://github.com/kabooma/s1api/blob/stable/S1API/PhoneApp/readme.md Illustrates how to register a custom phone application with the `S1API.PhoneAppManager` within a MelonLoader mod. It shows calling `PhoneAppManager.Register` during application startup and `PhoneAppManager.InitAll` when the relevant game scene is loaded. ```C# using MelonLoader; using S1API.PhoneApp; public class MyMod : MelonMod { public override void OnApplicationStart() { PhoneAppManager.Register(new MyAwesomeApp()); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "MainScene") // Replace with your in-game scene { PhoneAppManager.InitAll(LoggerInstance); } } } ``` -------------------------------- ### Defining Internal Namespace Structure - C# Source: https://github.com/kabooma/s1api/blob/stable/CODING_STANDARDS.md Shows how internal API code should be placed within `S1API.Internal` sub-namespaces to maintain a logical structure matching folder organization and clearly distinguish internal components from the public API. ```C# namespace S1API.Internal.Utils { ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.