SDK API Overview
The MCE SDK provides a clean, stable public API surface for interacting with the engine from your game code. All SDK interfaces live in the OpenMon.MCE.SDK namespace.
Design Principles
- Interface-based: All public APIs are exposed as interfaces, not concrete classes. This allows the implementation to evolve without breaking your code.
- Read-heavy: Most SDK methods are read-only queries. Mutations happen through the engine's internal systems (CommandGraph, Inspector, etc.).
- Event-driven: Key state changes are communicated through C# events.
- Zenject-injected: Access SDK interfaces via
[Inject]attribute.
Entry Point
The main entry point is IMonsterCaptureEngine:
[Inject] private IMonsterCaptureEngine engine;
From this interface, you access all subsystems:
| Property | Interface | Purpose |
|---|---|---|
engine.Database | IMonsterDatabase | Query monsters, moves, items, types |
engine.Battle | IBattleSystem | Battle state and events |
engine.Player | IPlayerData | Player roster, money, name, badges |
engine.SaveSystem | ISaveSystem | Save/load operations |
engine.Version | string | Engine version string |
Quick Example
using OpenMon.MCE.SDK;
using Zenject;
public class GameDashboard : MonoBehaviour
{
[Inject] private IMonsterCaptureEngine engine;
private void Start()
{
// Query database
var allMonsters = engine.Database.GetAllMonsters();
Debug.Log($"Database has {allMonsters.Count} monster species");
// Check player state
Debug.Log($"Player: {engine.Player.PlayerName}");
Debug.Log($"Team size: {engine.Player.PlayerRoster.Count}");
Debug.Log($"Money: {engine.Player.Money}");
Debug.Log($"Badges: {engine.Player.BadgeCount}");
// Listen to battle events
engine.Battle.OnBattleStarted += () => Debug.Log("Battle!");
engine.Battle.OnBattleEnded += (won) => Debug.Log($"Won: {won}");
// Save/load
if (engine.SaveSystem.HasSaveData(0))
Debug.Log("Save slot 0 has data");
}
}
See the individual API pages for detailed documentation of each interface.