MarkupParseResult
public struct MarkupParseResultInherits from System.ValueType
See also
Yarn.Markup.LineParser.ParseString
#Constructors
#MarkupParseResult(string, List<MarkupAttribute>)
public MarkupParseResult(string text, List<MarkupAttribute> attributes)Parameters
textstringThe plain text.attributesSystem.Collections.Generic.List<Yarn.Markup.MarkupAttribute>The list of attributes.
#Properties
#Attributes
public List<MarkupAttribute> Attributes { get; }Type List
#Text
public string Text { get; }Type String
#Methods
#DeleteRange(MarkupAttribute)
public readonly MarkupParseResult DeleteRange(MarkupAttribute attributeToDelete)Parameters
attributeToDeleteYarn.Markup.MarkupAttributeThe attribute to remove.
Returns MarkupParseResult: A new MarkupParseResult object, with the
plain text modified and an updated collection of
attributes.
attributeToDelete, and updates the other attributes in this
markup as follows:- Attributes that start and end before the deleted attribute are unmodified.
- Attributes that start before the deleted attribute and end inside it are truncated to remove the part overlapping the deleted attribute.
- Attributes that have the same position and length as the deleted attribute are deleted, if they apply to any text.
- Attributes that start and end within the deleted attribute are deleted.
- Attributes that start within the deleted attribute, and end outside it, have their start truncated to remove the part overlapping the deleted attribute.
- Attributes that start after the deleted attribute have their start point adjusted to account for the deleted text.
This method does not modify the current object. A new MarkupParseResult is returned.
If attributeToDelete is not an attribute of this
MarkupParseResult, the behaviour is undefined.
#TextForAttribute(MarkupAttribute)
attribute Position and Length properties.public readonly string TextForAttribute(MarkupAttribute attribute)Parameters
attributeYarn.Markup.MarkupAttributeThe attribute to get the text for.
Returns String: The text contained within the attribute.
If the attribute's Length property is zero, this method returns the empty string.
This method does not check to see if attribute is an attribute belonging to this
MarkupParseResult. As a result, if you pass an attribute that
doesn't belong, it may describe a range of text that does not
appear in Text. If this occurs, an System.IndexOutOfRangeException will be thrown.
#TryGetAttributeWithName(string, MarkupAttribute)
public readonly bool TryGetAttributeWithName(string name, out MarkupAttribute attribute)Parameters
namestringThe name of the attribute to get.attributeYarn.Markup.MarkupAttributeWhen this method returns, contains the attribute with the specified name, if the attribute is found; otherwise, the default MarkupAttribute. This parameter is passed uninitialized.
Returns Boolean: true if the MarkupParseResult contains an attribute with the
specified name; otherwise, false.
Generated from Yarn Spinner for Unity 3.3.