Ejemplo n.º 1
0
        public string GetStringValue(string fieldName)
        {
            var elementOffset = table.ElementContent.Until(segment => segment.Name == fieldName).Sum(segment => segment.Length);
            var valueAddress  = table.Start + table.ElementLength * arrayIndex + elementOffset;
            var seg           = table.ElementContent.Single(segment => segment.Name == fieldName);

            if (seg.Type == ElementContentType.PCS)
            {
                return(PCSString.Convert(model, valueAddress, seg.Length));
            }
            else if (seg.Type == ElementContentType.Pointer)
            {
                valueAddress = model.ReadPointer(valueAddress);
                var length = PCSString.ReadString(model, valueAddress, true);
                return(PCSString.Convert(model, valueAddress, length));
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 2
0
 public string Convert(IReadOnlyList <byte> data, int startIndex, int length)
 {
     return(PCSString.Convert(gameCode, data, startIndex, length));
 }
Ejemplo n.º 3
0
 public List <byte> Convert(string text, out bool containsBadCharacters)
 {
     return(PCSString.Convert(text, gameCode, out containsBadCharacters));
 }