using System; using Substrate.Core; namespace Substrate.Nbt { /// /// A collection of static methods that can be hooked into events for logging NBT errors to the console. /// public static class VerifierLogger { /// /// Logs an occurance of a missing tag error, and advances to the next event in the event chain. /// /// Data about the NBT node being verified. /// A indicating whether event processing should pass, fail, or advance. public static TagEventCode MissingTagHandler (TagEventArgs e) { Console.WriteLine("Missing Tag Error: '{0}'", e.TagName); return TagEventCode.NEXT; } /// /// Logs an occurance of an invalid tag type error, and advances to the next event in the event chain. /// /// Data about the NBT node being verified. /// A indicating whether event processing should pass, fail, or advance. public static TagEventCode InvalidTagTypeHandler (TagEventArgs e) { Console.WriteLine("Invalid Tag Type Error: '{0}' has type '{1}', expected '{2}'", e.TagName, e.Tag.GetTagType(), e.Schema.ToString()); return TagEventCode.NEXT; } /// /// Logs an occurance of an invalid tag value error, and advances to the next event in the event chain. /// /// Data about the NBT node being verified. /// A indicating whether event processing should pass, fail, or advance. public static TagEventCode InvalidTagValueHandler (TagEventArgs e) { Console.WriteLine("Invalid Tag Value Error: '{0}' of type '{1}' is set to invalid value '{2}'", e.TagName, e.Tag.GetTagType(), e.Tag.ToString()); return TagEventCode.NEXT; } } }