A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using System;
5using osu.Framework.Graphics.Sprites;
6
7namespace osu.Framework.Graphics.Containers
8{
9 internal class TextChunk<T>
10 where T : SpriteText
11 {
12 public readonly string Text;
13 public readonly bool NewLineIsParagraph;
14 internal readonly Action<T> CreationParameters;
15
16 public TextChunk(string text, bool newLineIsParagraph, Action<T> creationParameters = null)
17 {
18 Text = text;
19 NewLineIsParagraph = newLineIsParagraph;
20 CreationParameters = creationParameters;
21 }
22
23 public void ApplyParameters(T spriteText)
24 {
25 CreationParameters?.Invoke(spriteText);
26 }
27 }
28}