2025-08-09 15:14:44 +09:00
|
|
|
// Test world creation
|
2025-09-25 00:41:56 +09:00
|
|
|
using "text_adventure/simple_rooms.nyash"
|
2025-08-09 15:14:44 +09:00
|
|
|
|
|
|
|
|
print("Testing createSimpleWorld()...")
|
|
|
|
|
|
|
|
|
|
// Call the function
|
|
|
|
|
world = createSimpleWorld()
|
|
|
|
|
|
|
|
|
|
print("World created!")
|
|
|
|
|
print("Type check - does it have name?")
|
|
|
|
|
|
|
|
|
|
// Try different ways to access
|
|
|
|
|
try {
|
|
|
|
|
print("Attempting world.name...")
|
|
|
|
|
name = world.name
|
|
|
|
|
print("Success! Name: " + name)
|
|
|
|
|
} catch {
|
|
|
|
|
print("ERROR: Cannot access world.name")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Test if it's really a Room
|
|
|
|
|
print("\nTesting if it's a Room...")
|
|
|
|
|
try {
|
|
|
|
|
print("Calling world.look()...")
|
|
|
|
|
result = world.look()
|
|
|
|
|
print("Look result:")
|
|
|
|
|
print(result)
|
|
|
|
|
} catch {
|
|
|
|
|
print("ERROR: Cannot call look()")
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 00:41:56 +09:00
|
|
|
print("\n✅ World creation test completed!")
|