 	### 
 	It draws a character at given row and column
 	Returns the width of the character in number of blocks
+	@param 	ch 	String 	A character to draw
+	@param 	row Number 	Current character's row
+	@param 	col Number 	Current character's column
 	###
 	drawCharacter: (ch, row, col) ->
 		# Lowercase the character

		# Return the character width
		current_ch.length

	preCreateCubes: (cube_count) ->
		html_string = ''
		for i in [1...cube_count]
			current_cube = @cube_template



class IsoBlocks
	# Starting x cordinate on the screen
	origin_x: 0
	# Starting y cordinate on the screen
	origin_y: 0

	# Spacing between 2 characters in terms of number of blocks
	character_spacing: 1

	# Array of pre-generated cubes which are used throughout.
	cubes: []

	# Current cube index in the @cubes array to be used for drawing
	current_cube_index: 0

	# An HTML string template for a block
	cube_template: '<div class="iso_block @color unused" style="left:@leftpx; top:@toppx"></div>'

	###
	Constructor
	@param	num_cubes	Number 	Number of cubes to pre-generate
	###
	constructor: (num_cubes = 450) ->
		@preGenerateCubes num_cubes 

	###
	@params	s 	string 	String to draw
	@params	start_x	Number 	Starting x cordinate of the string
	@params	start_y	Number 	Starting y cordinate of the string
	###
	generate: (s, start_x, start_y) ->
		@origin_x = start_x
		@origin_y = start_y

		# Initialize the @current_cube_index to start using the cubes from end for current string
		@current_cube_index = @cubes.length - 1

		# Hide all cubes
		for cube in @cubes
			$(cube).addClass('unused')#.removeClass('iso_color_yellow iso_color_green')
			#$(cube).css 'top', parseInt($(cube).css('top'), 10) - 400

		current_row = 0
		current_col = 0

		# Loop throught the characters and keep drawing them
		for ch, index in s
			current_col += @drawCharacter ch, current_row, current_col

