public TagCompletionData(FF8TextTagCode code, IEnumerable values = null) : base(code) { if (values == null) { return; } foreach (Enum value in values) { DisplayAttribute data = GetDisplayAttribute(value); if (data != null) { _values.Add(new CompletionData(value)); } } }
public static FF8TextTag TryRead(Byte[] bytes, ref Int32 offset, ref Int32 left) { FF8TextTagCode code = (FF8TextTagCode)bytes[offset++]; left -= 2; switch (code) { case FF8TextTagCode.End: case FF8TextTagCode.Next: case FF8TextTagCode.Line: case FF8TextTagCode.Speaker: left++; return(new FF8TextTag(code)); case FF8TextTagCode.Pause: case FF8TextTagCode.Var: return(new FF8TextTag(code, (FF8TextTagParam)bytes[offset++])); case FF8TextTagCode.Char: return(new FF8TextTag(code, (FF8TextTagCharacter)bytes[offset++])); case FF8TextTagCode.Key: return(new FF8TextTag(code, (FF8TextTagKey)bytes[offset++])); case FF8TextTagCode.Color: return(new FF8TextTag(code, (FF8TextTagColor)bytes[offset++])); case FF8TextTagCode.Dialog: return(new FF8TextTag(code, (FF8TextTagDialog)bytes[offset++])); case FF8TextTagCode.Option: return(new FF8TextTag(code, (FF8TextTagOption)bytes[offset++])); case FF8TextTagCode.Term: return(new FF8TextTag(code, (FF8TextTagTerm)bytes[offset++])); default: left += 2; offset--; return(null); } }
public FF8TextTag(FF8TextTagCode code, Enum param = null) { Code = code; Param = param; }