Example #1
0
        public static Byte ToText(Byte bt)
        {
            if (ToChar.TryGetValue(bt, out Char value))
            {
                return((Byte)value);
            }

            if (_isRealCodepage)
            {
                return(0xFF); // It's valid game logic
            }
            throw new NotSupportedException($"[{bt:X2}]");
        }
Example #2
0
        /// <summary>
        /// Formats the location according to script preferences
        /// </summary>
        /// <param name="script">The script.</param>
        public string FormatLocation(Script script)
        {
            if (IsClrLocation)
            {
                return("[clr]");
            }

            if (FromLine == ToLine)
            {
                if (FromChar == ToChar)
                {
                    return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()})");
                }

                return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()}-{ToChar.ToString()})");
            }

            return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()}-{ToLine.ToString()},{ToChar.ToString()})");
        }
Example #3
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return($"{(IsStepStop ? "*" : " ")} ({FromLine.ToString()}, {FromChar.ToString()}) -> ({ToLine.ToString()}, {ToChar.ToString()})");
 }