Skip to content

Commit 9b72c3a

Browse files
committed
Split typewriter code into two files
1 parent 209014a commit 9b72c3a

File tree

4 files changed

+44
-27
lines changed

4 files changed

+44
-27
lines changed

Runtime/Views/Typewriter/AsyncTypewriter.cs renamed to Runtime/Views/Typewriter/BasicTypewriter.cs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#nullable enable
2+
13
namespace Yarn.Unity
24
{
35
using System;
@@ -6,33 +8,6 @@ namespace Yarn.Unity
68
using TMPro;
79
using UnityEngine;
810

9-
#nullable enable
10-
11-
/// <summary>
12-
/// An object that can handle delivery of a line's text over time.
13-
/// </summary>
14-
public interface IAsyncTypewriter
15-
{
16-
/// <summary>
17-
/// Displays the contents of a line over time.
18-
/// </summary>
19-
/// <remarks>
20-
/// <para>This method is called when a dialogue presenter wants to
21-
/// deliver a line's text. The typewriter should present the text to the
22-
/// user; it may take as long as it needs to do so. </para>
23-
///
24-
/// <para>If <paramref name="cancellationToken"/>'s <see
25-
/// cref="CancellationToken.IsCancellationRequested"/> becomes true, the
26-
/// typewriter effect should end early and present the entire contents
27-
/// of <paramref name="line"/>.</para>
28-
/// <param name="line">The line to display.</param>
29-
/// <param name="cancellationToken">A token that indicates that the
30-
/// typewriter effect should be cancelled.</param>
31-
/// <returns>A task that completes when the typewriter effect has
32-
/// finished.</returns>
33-
public YarnTask RunTypewriter(Markup.MarkupParseResult line, CancellationToken cancellationToken);
34-
}
35-
3611
/// <summary>
3712
/// An implementation of <see cref="IAsyncTypewriter"/> that delivers
3813
/// characters one at a time, and invokes any <see
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#nullable enable
2+
3+
namespace Yarn.Unity
4+
{
5+
using System.Threading;
6+
7+
/// <summary>
8+
/// An object that can handle delivery of a line's text over time.
9+
/// </summary>
10+
public interface IAsyncTypewriter
11+
{
12+
/// <summary>
13+
/// Displays the contents of a line over time.
14+
/// </summary>
15+
/// <remarks>
16+
/// <para>This method is called when a dialogue presenter wants to
17+
/// deliver a line's text. The typewriter should present the text to the
18+
/// user; it may take as long as it needs to do so. </para>
19+
///
20+
/// <para>If <paramref name="cancellationToken"/>'s <see
21+
/// cref="CancellationToken.IsCancellationRequested"/> becomes true, the
22+
/// typewriter effect should end early and present the entire contents
23+
/// of <paramref name="line"/>.</para>
24+
/// <param name="line">The line to display.</param>
25+
/// <param name="cancellationToken">A token that indicates that the
26+
/// typewriter effect should be cancelled.</param>
27+
/// <returns>A task that completes when the typewriter effect has
28+
/// finished.</returns>
29+
public YarnTask RunTypewriter(Markup.MarkupParseResult line, CancellationToken cancellationToken);
30+
}
31+
}

Runtime/Views/Typewriter/IAsyncTypewriter.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)