|
|
|
"""
|
|
Test script for the auto-discovery system
|
|
"""
|
|
|
|
from src.core.game_engine import GameEngine
|
|
from src.interfaces.npc_addon import get_registered_addons
|
|
|
|
def test_autodiscovery():
|
|
print("Testing auto-discovery system...")
|
|
|
|
|
|
engine = GameEngine()
|
|
engine.start()
|
|
|
|
|
|
addons = get_registered_addons()
|
|
print(f"\nDiscovered addons: {len(addons)}")
|
|
|
|
for addon_id, addon in addons.items():
|
|
print(f" - {addon_id}: {addon.addon_name}")
|
|
|
|
if hasattr(addon, 'npc_config') and addon.npc_config:
|
|
config = addon.npc_config
|
|
print(f" NPC: {config['id']} at position ({config['x']}, {config['y']})")
|
|
|
|
if hasattr(addon, 'ui_tab_name') and addon.ui_tab_name:
|
|
print(f" UI Tab: {addon.ui_tab_name}")
|
|
|
|
|
|
if 'weather_oracle' in addons:
|
|
print("\n✅ Weather Oracle addon successfully auto-discovered!")
|
|
else:
|
|
print("\n❌ Weather Oracle addon NOT discovered")
|
|
|
|
|
|
if 'fortune_teller' in addons:
|
|
print("✅ Fortune Teller addon successfully auto-discovered!")
|
|
else:
|
|
print("❌ Fortune Teller addon NOT discovered")
|
|
|
|
print(f"\nTotal addons discovered: {len(addons)}")
|
|
engine.stop()
|
|
|
|
if __name__ == "__main__":
|
|
test_autodiscovery()
|
|
|