public static FFXTextTag TryRead(byte[] bytes, ref int offset, ref int left) { FFXTextTagCode code = (FFXTextTagCode)bytes[offset++]; left -= 2; switch (code) { case FFXTextTagCode.End: case FFXTextTagCode.Next: case FFXTextTagCode.Line: case FFXTextTagCode.Point: case FFXTextTagCode.Music: case FFXTextTagCode.Heart: case FFXTextTagCode.Exclamation: case FFXTextTagCode.Up: case FFXTextTagCode.Down: case FFXTextTagCode.Left: case FFXTextTagCode.Right: case FFXTextTagCode.Beta: case FFXTextTagCode.Func: case FFXTextTagCode.Corp: case FFXTextTagCode.Reg: left++; return(new FFXTextTag(code)); case FFXTextTagCode.Var07: case FFXTextTagCode.Var12: case FFXTextTagCode.Color: return(new FFXTextTag(code, (FFXTextTagParam)bytes[offset++])); case FFXTextTagCode.Choise: return(new FFXTextTag(code, (FFXTextTagParam)bytes[offset++] - 0x30)); case FFXTextTagCode.Char: return(new FFXTextTag(code, (FFXTextTagCharacter)bytes[offset++])); case FFXTextTagCode.Npc: return(new FFXTextTag(code, (FFXTextTagNpc)bytes[offset++])); case FFXTextTagCode.Key: return(new FFXTextTag(code, (FFXTextTagKey)bytes[offset++])); case FFXTextTagCode.System: return(new FFXTextTag(code, (FFXTextTagSystem)bytes[offset++])); case FFXTextTagCode.Font: return(new FFXTextTag(code, (FFXTextTagFont)bytes[offset++])); case FFXTextTagCode.Area: return(new FFXTextTag(code, (FFXTextTagArea)bytes[offset++])); case FFXTextTagCode.Item: return(new FFXTextTag(code, (FFXTextTagItem)bytes[offset++])); default: left += 2; offset--; return(null); } }
public FFXTextTag(FFXTextTagCode code, Enum param = null) { Code = code; Param = param; }