32 lines
614 B
C#
32 lines
614 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace Rokojori
|
|
{
|
|
|
|
// Standalone cursor engine - knows nothing about DialogManager, UI, or the
|
|
// simulation loop. Only ever talks to the display it was given.
|
|
public class DialogProcessor
|
|
{
|
|
public IDialogDisplay _display = null;
|
|
|
|
public static DialogProcessor Create( IDialogDisplay display )
|
|
{
|
|
var processor = new DialogProcessor();
|
|
processor._display = display;
|
|
|
|
return processor;
|
|
}
|
|
|
|
public async Task Run( DialogBlock start )
|
|
{
|
|
var current = start;
|
|
|
|
while ( current != null )
|
|
{
|
|
current = await current.Run( _display );
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|