using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.Skyscraper.Text
{
    internal class AsciiTable
    {
        internal static void GetAsciiChar(byte req, StringBuilder resultBuilder)
        {
            switch (req)
            {
                case 0x00: resultBuilder.Append('\0'); break;   //Null
                case 0x01: break;                               //Start of Header?
                case 0x02: break;                               //Start of text
                case 0x03: break;                               //End of text
                case 0x04: break;                               //End of transmission? Sure doesn't look like it.
                case 0x05: break;                               //Enquiry?
                case 0x06: break;                               //Acknowledge?
                case 0x07: resultBuilder.Append('\a'); break;   //Bell
                case 0x08: resultBuilder.Append('\b'); break;   //Backspace
                case 0x09: resultBuilder.Append('\t'); break;   //Horizontal Tab
                case 0x0a: resultBuilder.Append('\n'); break;   //Line Feed
                case 0x0b: resultBuilder.Append('\v'); break;   //Vertical Tab
                case 0x0c: resultBuilder.Append('\f'); break;   //Form Feed
                case 0x0d: resultBuilder.Append('\r'); break;   //Carriage Return
                case 0x0e: break;                               //Shift Out?
                case 0x0f: break;                               //Shift in?
                case 0x10: break;                               //Data Link Escape?
                case 0x11: break;                               // XON / XOFF
                case 0x12: break;                               //Device Control 2?
                case 0x13: break;                               //Device Control 3?
                case 0x14: break;                               //Device Control 4?
                case 0x15: break;                               //NAK
                case 0x16: break;                               //Idle (SYN)
                case 0x17: break;                               //End of Transmission Block?
                case 0x18: break;                               //Cancel?
                case 0x19: break;                               //End of Medium?
                case 0x1a: break;                               //Substitute?
                case 0x1b: resultBuilder.Append('\b'); break;   //Escape
                case 0x1c: break;                               //File Separator?
                case 0x1d: break;                               //Group Separator?
                case 0x1e: break;                               //Record Separator?
                case 0x1f: break;                               //Unit Separator?
                case 0x20: resultBuilder.Append(' '); break;
                case 0x21: resultBuilder.Append('!'); break;
                case 0x22: resultBuilder.Append('\"'); break;
                case 0x23: resultBuilder.Append('#'); break;
                case 0x24: resultBuilder.Append('$'); break;
                case 0x25: resultBuilder.Append('%'); break;
                case 0x26: resultBuilder.Append('&'); break;
                case 0x27: resultBuilder.Append('\''); break;
                case 0x28: resultBuilder.Append('('); break;
                case 0x29: resultBuilder.Append(')'); break;
                case 0x2a: resultBuilder.Append('*'); break;
                case 0x2b: resultBuilder.Append('+'); break;
                case 0x2c: resultBuilder.Append(','); break;
                case 0x2d: resultBuilder.Append('-'); break;
                case 0x2e: resultBuilder.Append('.'); break;
                case 0x2f: resultBuilder.Append('/'); break;
                case 0x30: resultBuilder.Append('0'); break;
                case 0x31: resultBuilder.Append('1'); break;
                case 0x32: resultBuilder.Append('2'); break;
                case 0x33: resultBuilder.Append('3'); break;
                case 0x34: resultBuilder.Append('4'); break;
                case 0x35: resultBuilder.Append('5'); break;
                case 0x36: resultBuilder.Append('6'); break;
                case 0x37: resultBuilder.Append('7'); break;
                case 0x38: resultBuilder.Append('8'); break;
                case 0x39: resultBuilder.Append('9'); break;
                case 0x3a: resultBuilder.Append(':'); break;
                case 0x3b: resultBuilder.Append(';'); break;
                case 0x3c: resultBuilder.Append('<'); break;
                case 0x3d: resultBuilder.Append('='); break;
                case 0x3e: resultBuilder.Append('>'); break;
                case 0x3f: resultBuilder.Append('?'); break;
                case 0x40: resultBuilder.Append('@'); break;
                case 0x41: resultBuilder.Append('A'); break;
                case 0x42: resultBuilder.Append('B'); break;
                case 0x43: resultBuilder.Append('C'); break;
                case 0x44: resultBuilder.Append('D'); break;
                case 0x45: resultBuilder.Append('E'); break;
                case 0x46: resultBuilder.Append('F'); break;
                case 0x47: resultBuilder.Append('G'); break;
                case 0x48: resultBuilder.Append('H'); break;
                case 0x49: resultBuilder.Append('I'); break;
                case 0x4a: resultBuilder.Append('J'); break;
                case 0x4b: resultBuilder.Append('K'); break;
                case 0x4c: resultBuilder.Append('L'); break;
                case 0x4d: resultBuilder.Append('M'); break;
                case 0x4e: resultBuilder.Append('N'); break;
                case 0x4f: resultBuilder.Append('O'); break;
                case 0x50: resultBuilder.Append('P'); break;
                case 0x51: resultBuilder.Append('Q'); break;
                case 0x52: resultBuilder.Append('R'); break;
                case 0x53: resultBuilder.Append('S'); break;
                case 0x54: resultBuilder.Append('T'); break;
                case 0x55: resultBuilder.Append('U'); break;
                case 0x56: resultBuilder.Append('V'); break;
                case 0x57: resultBuilder.Append('W'); break;
                case 0x58: resultBuilder.Append('X'); break;
                case 0x59: resultBuilder.Append('Y'); break;
                case 0x5a: resultBuilder.Append('Z'); break;
                case 0x5b: resultBuilder.Append('['); break;
                case 0x5c: resultBuilder.Append('\\'); break;
                case 0x5d: resultBuilder.Append(']'); break;
                case 0x5e: resultBuilder.Append('^'); break;
                case 0x5f: resultBuilder.Append('_'); break;
                case 0x60: resultBuilder.Append('`'); break;
                case 0x61: resultBuilder.Append('a'); break;
                case 0x62: resultBuilder.Append('b'); break;
                case 0x63: resultBuilder.Append('c'); break;
                case 0x64: resultBuilder.Append('d'); break;
                case 0x65: resultBuilder.Append('e'); break;
                case 0x66: resultBuilder.Append('f'); break;
                case 0x67: resultBuilder.Append('g'); break;
                case 0x68: resultBuilder.Append('h'); break;
                case 0x69: resultBuilder.Append('i'); break;
                case 0x6a: resultBuilder.Append('j'); break;
                case 0x6b: resultBuilder.Append('k'); break;
                case 0x6c: resultBuilder.Append('l'); break;
                case 0x6d: resultBuilder.Append('m'); break;
                case 0x6e: resultBuilder.Append('n'); break;
                case 0x6f: resultBuilder.Append('o'); break;
                case 0x70: resultBuilder.Append('p'); break;
                case 0x71: resultBuilder.Append('q'); break;
                case 0x72: resultBuilder.Append('r'); break;
                case 0x73: resultBuilder.Append('s'); break;
                case 0x74: resultBuilder.Append('t'); break;
                case 0x75: resultBuilder.Append('u'); break;
                case 0x76: resultBuilder.Append('v'); break;
                case 0x77: resultBuilder.Append('w'); break;
                case 0x78: resultBuilder.Append('x'); break;
                case 0x79: resultBuilder.Append('y'); break;
                case 0x7a: resultBuilder.Append('z'); break;
                case 0x7b: resultBuilder.Append('{'); break;
                case 0x7c: resultBuilder.Append('|'); break;
                case 0x7d: resultBuilder.Append('}'); break;
                case 0x7e: resultBuilder.Append('~'); break;
                case 0x7f: resultBuilder.Append('\u007f'); break;
                default:
                    throw new NotImplementedException(String.Format("0x{0:X2}", req));
            }
        }
    }
}
