package projectzombie.text;

import gl_engine.matrix.Matrix4;
import projectzombie.init.Resources;
import projectzombie.model.Model;
import projectzombie.model.ModelGui;

public class Text
{
	public static final Model CHAR_A = new ModelGui(Resources.ATLAS.get("/text/char_u_a.png"));
	public static final Model CHAR_B = new ModelGui(Resources.ATLAS.get("/text/char_u_b.png"));
	public static final Model CHAR_C = new ModelGui(Resources.ATLAS.get("/text/char_u_c.png"));
	public static final Model CHAR_D = new ModelGui(Resources.ATLAS.get("/text/char_u_d.png"));
	public static final Model CHAR_E = new ModelGui(Resources.ATLAS.get("/text/char_u_e.png"));
	public static final Model CHAR_F = new ModelGui(Resources.ATLAS.get("/text/char_u_f.png"));
	public static final Model CHAR_G = new ModelGui(Resources.ATLAS.get("/text/char_u_g.png"));
	public static final Model CHAR_H = new ModelGui(Resources.ATLAS.get("/text/char_u_h.png"));
	public static final Model CHAR_I = new ModelGui(Resources.ATLAS.get("/text/char_u_i.png"));
	public static final Model CHAR_J = new ModelGui(Resources.ATLAS.get("/text/char_u_j.png"));
	public static final Model CHAR_K = new ModelGui(Resources.ATLAS.get("/text/char_u_k.png"));
	public static final Model CHAR_L = new ModelGui(Resources.ATLAS.get("/text/char_u_l.png"));
	public static final Model CHAR_M = new ModelGui(Resources.ATLAS.get("/text/char_u_m.png"));
	public static final Model CHAR_N = new ModelGui(Resources.ATLAS.get("/text/char_u_n.png"));
	public static final Model CHAR_O = new ModelGui(Resources.ATLAS.get("/text/char_u_o.png"));
	public static final Model CHAR_P = new ModelGui(Resources.ATLAS.get("/text/char_u_p.png"));
	public static final Model CHAR_Q = new ModelGui(Resources.ATLAS.get("/text/char_u_q.png"));
	public static final Model CHAR_R = new ModelGui(Resources.ATLAS.get("/text/char_u_r.png"));
	public static final Model CHAR_S = new ModelGui(Resources.ATLAS.get("/text/char_u_s.png"));
	public static final Model CHAR_T = new ModelGui(Resources.ATLAS.get("/text/char_u_t.png"));
	public static final Model CHAR_U = new ModelGui(Resources.ATLAS.get("/text/char_u_u.png"));
	public static final Model CHAR_V = new ModelGui(Resources.ATLAS.get("/text/char_u_v.png"));
	public static final Model CHAR_W = new ModelGui(Resources.ATLAS.get("/text/char_u_w.png"));
	public static final Model CHAR_X = new ModelGui(Resources.ATLAS.get("/text/char_u_x.png"));
	public static final Model CHAR_Y = new ModelGui(Resources.ATLAS.get("/text/char_u_y.png"));
	public static final Model CHAR_Z = new ModelGui(Resources.ATLAS.get("/text/char_u_z.png"));
	public static final Model CHAR_a = new ModelGui(Resources.ATLAS.get("/text/char_l_a.png"));
	public static final Model CHAR_b = new ModelGui(Resources.ATLAS.get("/text/char_l_b.png"));
	public static final Model CHAR_c = new ModelGui(Resources.ATLAS.get("/text/char_l_c.png"));
	public static final Model CHAR_d = new ModelGui(Resources.ATLAS.get("/text/char_l_d.png"));
	public static final Model CHAR_e = new ModelGui(Resources.ATLAS.get("/text/char_l_e.png"));
	public static final Model CHAR_f = new ModelGui(Resources.ATLAS.get("/text/char_l_f.png"));
	public static final Model CHAR_g = new ModelGui(Resources.ATLAS.get("/text/char_l_g.png"));
	public static final Model CHAR_i = new ModelGui(Resources.ATLAS.get("/text/char_l_i.png"));
	public static final Model CHAR_h = new ModelGui(Resources.ATLAS.get("/text/char_l_h.png"));
	public static final Model CHAR_j = new ModelGui(Resources.ATLAS.get("/text/char_l_j.png"));
	public static final Model CHAR_k = new ModelGui(Resources.ATLAS.get("/text/char_l_k.png"));
	public static final Model CHAR_l = new ModelGui(Resources.ATLAS.get("/text/char_l_l.png"));
	public static final Model CHAR_m = new ModelGui(Resources.ATLAS.get("/text/char_l_m.png"));
	public static final Model CHAR_n = new ModelGui(Resources.ATLAS.get("/text/char_l_n.png"));
	public static final Model CHAR_o = new ModelGui(Resources.ATLAS.get("/text/char_l_o.png"));
	public static final Model CHAR_p = new ModelGui(Resources.ATLAS.get("/text/char_l_p.png"));
	public static final Model CHAR_q = new ModelGui(Resources.ATLAS.get("/text/char_l_q.png"));
	public static final Model CHAR_r = new ModelGui(Resources.ATLAS.get("/text/char_l_r.png"));
	public static final Model CHAR_s = new ModelGui(Resources.ATLAS.get("/text/char_l_s.png"));
	public static final Model CHAR_t = new ModelGui(Resources.ATLAS.get("/text/char_l_t.png"));
	public static final Model CHAR_u = new ModelGui(Resources.ATLAS.get("/text/char_l_u.png"));
	public static final Model CHAR_v = new ModelGui(Resources.ATLAS.get("/text/char_l_v.png"));
	public static final Model CHAR_w = new ModelGui(Resources.ATLAS.get("/text/char_l_w.png"));
	public static final Model CHAR_x = new ModelGui(Resources.ATLAS.get("/text/char_l_x.png"));
	public static final Model CHAR_y = new ModelGui(Resources.ATLAS.get("/text/char_l_y.png"));
	public static final Model CHAR_z = new ModelGui(Resources.ATLAS.get("/text/char_l_z.png"));
	public static final Model CHAR_0 = new ModelGui(Resources.ATLAS.get("/text/char_0.png"));
	public static final Model CHAR_1 = new ModelGui(Resources.ATLAS.get("/text/char_1.png"));
	public static final Model CHAR_2 = new ModelGui(Resources.ATLAS.get("/text/char_2.png"));
	public static final Model CHAR_3 = new ModelGui(Resources.ATLAS.get("/text/char_3.png"));
	public static final Model CHAR_4 = new ModelGui(Resources.ATLAS.get("/text/char_4.png"));
	public static final Model CHAR_5 = new ModelGui(Resources.ATLAS.get("/text/char_5.png"));
	public static final Model CHAR_6 = new ModelGui(Resources.ATLAS.get("/text/char_6.png"));
	public static final Model CHAR_7 = new ModelGui(Resources.ATLAS.get("/text/char_7.png"));
	public static final Model CHAR_8 = new ModelGui(Resources.ATLAS.get("/text/char_8.png"));
	public static final Model CHAR_9 = new ModelGui(Resources.ATLAS.get("/text/char_9.png"));
	public static final Model CHAR_FULLSTOP		= new ModelGui(Resources.ATLAS.get("/text/char_fullstop.png"));
	public static final Model CHAR_COLON		= new ModelGui(Resources.ATLAS.get("/text/char_colon.png"));
	public static final Model CHAR_COMMA		= new ModelGui(Resources.ATLAS.get("/text/char_comma.png"));
	public static final Model CHAR_EXMARK		= new ModelGui(Resources.ATLAS.get("/text/char_exclamation.png"));
	public static final Model CHAR_MINUS		= new ModelGui(Resources.ATLAS.get("/text/char_minus.png"));
	public static final Model CHAR_PLUS			= new ModelGui(Resources.ATLAS.get("/text/char_plus.png"));
	public static final Model CHAR_F_SLASH		= new ModelGui(Resources.ATLAS.get("/text/char_fslash.png"));
	public static final Model CHAR_B_SLASH		= new ModelGui(Resources.ATLAS.get("/text/char_bslash.png"));
	public static final Model CHAR_EQUALS		= new ModelGui(Resources.ATLAS.get("/text/char_equals.png"));
	public static final Model CHAR_USCORE		= new ModelGui(Resources.ATLAS.get("/text/char_underscore.png"));
	public static final Model CHAR_NULL			= new ModelGui(Resources.ATLAS.get("/text/char_unknown.png"));
	public static final Model CHAR_BRACKET_O	= new ModelGui(Resources.ATLAS.get("/text/char_obracket.png"));
	public static final Model CHAR_BRACKET_C	= new ModelGui(Resources.ATLAS.get("/text/char_cbracket.png"));
	public static final Model CHAR_PERCENT		= new ModelGui(Resources.ATLAS.get("/text/char_percent.png"));
	public static final Model CHAR_VBAR			= new ModelGui(Resources.ATLAS.get("/text/char_vertical.png"));
	public static final Model CHAR_QMARK		= new ModelGui(Resources.ATLAS.get("/text/char_question.png"));
	public static final Model CHAR_DOLLAR		= new ModelGui(Resources.ATLAS.get("/text/char_dollar.png"));
	public static final Model CHAR_HASHTAG		= new ModelGui(Resources.ATLAS.get("/text/char_hashtag.png"));
	public static final Model CHAR_L_THAN		= new ModelGui(Resources.ATLAS.get("/text/char_lthan.png"));
	public static final Model CHAR_G_THAN		= new ModelGui(Resources.ATLAS.get("/text/char_gthan.png"));
	public static final Model CHAR_APOSTROPHE	= new ModelGui(Resources.ATLAS.get("/text/char_apostrophe.png"));
	public static final Model CHAR_GRAVE		= new ModelGui(Resources.ATLAS.get("/text/char_grave.png"));
	public static final Model CHAR_QUOTATION	= new ModelGui(Resources.ATLAS.get("/text/char_quotation.png"));
	public static final Model CHAR_SEMICOLON	= new ModelGui(Resources.ATLAS.get("/text/char_semicolon.png"));
	public static final Model CHAR_TILDE		= new ModelGui(Resources.ATLAS.get("/text/char_tilde.png"));
	public static final Model CHAR_BRACKET_OC	= new ModelGui(Resources.ATLAS.get("/text/char_ocbracket.png"));
	public static final Model CHAR_BRACKET_CC	= new ModelGui(Resources.ATLAS.get("/text/char_ccbracket.png"));
	public static final Model CHAR_BRACKET_OS	= new ModelGui(Resources.ATLAS.get("/text/char_osbracket.png"));
	public static final Model CHAR_BRACKET_CS	= new ModelGui(Resources.ATLAS.get("/text/char_csbracket.png"));
	public static final Model CHAR_STAR			= new ModelGui(Resources.ATLAS.get("/text/char_star.png"));
	public static final Model CHAR_AND			= new ModelGui(Resources.ATLAS.get("/text/char_and.png"));
	public static final Model CHAR_AT			= new ModelGui(Resources.ATLAS.get("/text/char_at.png"));
	public static final Model CHAR_POW			= new ModelGui(Resources.ATLAS.get("/text/char_pow.png"));
	
	public static void render(String text, Matrix4 matrix)
	{
		// Get the bytes from the string
		byte[] text_b = text.getBytes();
		
		// Loop over the bytes
		for(int i=0;i<text_b.length;i++)
		{
			// Get the character from the string
			Model l = CHAR_NULL;
			switch(text_b[i]) {
				case(' '): l = null; break;
				case('Q'): l = CHAR_Q; break;
				case('W'): l = CHAR_W; break;
				case('E'): l = CHAR_E; break;
				case('R'): l = CHAR_R; break;
				case('T'): l = CHAR_T; break;
				case('Y'): l = CHAR_Y; break;
				case('U'): l = CHAR_U; break;
				case('I'): l = CHAR_I; break;
				case('O'): l = CHAR_O; break;
				case('P'): l = CHAR_P; break;
				case('A'): l = CHAR_A; break;
				case('S'): l = CHAR_S; break;
				case('D'): l = CHAR_D; break;
				case('F'): l = CHAR_F; break;
				case('G'): l = CHAR_G; break;
				case('H'): l = CHAR_H; break;
				case('J'): l = CHAR_J; break;
				case('K'): l = CHAR_K; break;
				case('L'): l = CHAR_L; break;
				case('Z'): l = CHAR_Z; break;
				case('X'): l = CHAR_X; break;
				case('C'): l = CHAR_C; break;
				case('V'): l = CHAR_V; break;
				case('B'): l = CHAR_B; break;
				case('N'): l = CHAR_N; break;
				case('M'): l = CHAR_M; break;
				case('q'): l = CHAR_q; break;
				case('w'): l = CHAR_w; break;
				case('e'): l = CHAR_e; break;
				case('r'): l = CHAR_r; break;
				case('t'): l = CHAR_t; break;
				case('y'): l = CHAR_y; break;
				case('u'): l = CHAR_u; break;
				case('i'): l = CHAR_i; break;
				case('o'): l = CHAR_o; break;
				case('p'): l = CHAR_p; break;
				case('a'): l = CHAR_a; break;
				case('s'): l = CHAR_s; break;
				case('d'): l = CHAR_d; break;
				case('f'): l = CHAR_f; break;
				case('g'): l = CHAR_g; break;
				case('h'): l = CHAR_h; break;
				case('j'): l = CHAR_j; break;
				case('k'): l = CHAR_k; break;
				case('l'): l = CHAR_l; break;
				case('z'): l = CHAR_z; break;
				case('x'): l = CHAR_x; break;
				case('c'): l = CHAR_c; break;
				case('v'): l = CHAR_v; break;
				case('b'): l = CHAR_b; break;
				case('n'): l = CHAR_n; break;
				case('m'): l = CHAR_m; break;
				case('0'): l = CHAR_0; break;
				case('1'): l = CHAR_1; break;
				case('2'): l = CHAR_2; break;
				case('3'): l = CHAR_3; break;
				case('4'): l = CHAR_4; break;
				case('5'): l = CHAR_5; break;
				case('6'): l = CHAR_6; break;
				case('7'): l = CHAR_7; break;
				case('8'): l = CHAR_8; break;
				case('9'): l = CHAR_9; break;
				case(':'): l = CHAR_COLON; break;
				case(','): l = CHAR_COMMA; break;
				case('.'): l = CHAR_FULLSTOP; break;
				case('!'): l = CHAR_EXMARK; break;
				case('-'): l = CHAR_MINUS; break;
				case('+'): l = CHAR_PLUS; break;
				case('/'): l = CHAR_F_SLASH; break;
				case('\\'): l = CHAR_B_SLASH; break;
				case('='): l = CHAR_EQUALS; break;
				case('_'): l = CHAR_USCORE; break;
				case('('): l = CHAR_BRACKET_O; break;
				case(')'): l = CHAR_BRACKET_C; break;
				case('%'): l = CHAR_PERCENT; break;
				case('|'): l = CHAR_VBAR; break;
				case('?'): l = CHAR_QMARK; break;
				case('$'): l = CHAR_DOLLAR; break;
				case('#'): l = CHAR_HASHTAG; break;
				case('>'): l = CHAR_G_THAN; break;
				case('<'): l = CHAR_L_THAN; break;
				case('`'): l = CHAR_GRAVE; break;
				case('~'): l = CHAR_TILDE; break;
				case('\''): l = CHAR_APOSTROPHE; break;
				case('"'): l = CHAR_QUOTATION; break;
				case(';'): l = CHAR_SEMICOLON; break;
				case('@'): l = CHAR_AT; break;
				case('&'): l = CHAR_AND; break;
				case('*'): l = CHAR_STAR; break;
				case('^'): l = CHAR_POW; break;
				case('['): l = CHAR_BRACKET_OS; break;
				case(']'): l = CHAR_BRACKET_CS; break;
				case('{'): l = CHAR_BRACKET_OC; break;
				case('}'): l = CHAR_BRACKET_CC; break;
			}
			
			if(l != null)
			{
				Matrix4 model = Matrix4.multiply(Matrix4.translate(i, 0, 0), matrix);
				
				l.setModel(model);
				l.render();
			}
		}
	}
}
