\ExplSyntaxOn
	\usepackage{tikz}

	\tl_set:Nn\l_pgfgo_goban_scale_tl{1}
	\bool_set_false:N\l_pgfgo_goban_partial_bool
	\tl_set:Nn\l_pgfgo_goban_from_x_tl{1}
	\tl_set:Nn\l_pgfgo_goban_from_y_tl{1}
	\tl_set:Nn\l_pgfgo_goban_to_x_tl{9}
	\tl_set:Nn\l_pgfgo_goban_to_y_tl{9}


	%GRID
	\bool_set_true:N\l_pgfgo_goban_grid_bool
	\tl_set:Nn\l_pgfgo_goban_grid_color_tl{black}
	\tl_set:Nn\l_pgfgo_goban_grid_opacity_tl{1}
	\dim_new:N\l_pgfgo_goban_grid_line_width_dim
	\dim_set:Nn\l_pgfgo_goban_grid_line_width_dim{0.55pt}
	\dim_new:N\l_pgfgo_goban_grid_x_sep_dim
	\dim_new:N\l_pgfgo_goban_grid_y_sep_dim
	\dim_set:Nn\l_pgfgo_goban_grid_x_sep_dim{1.25em}
	\dim_set:Nn\l_pgfgo_goban_grid_y_sep_dim{1.25em}


	%BORDER
	\bool_set_true:N\l_pgfgo_goban_border_bool
	\bool_set_true:N\l_pgfgo_goban_border_line_bool
	\bool_set_true:N\l_pgfgo_goban_border_fill_bool

	\dim_new:N\l_pgfgo_goban_border_sep_dim
	\dim_set:Nn\l_pgfgo_goban_border_sep_dim{\fp_to_dim:n{\l_pgfgo_players_stone_radius_dim * 1.5}}
	\tl_set:Nn\l_pgfgo_goban_border_color_tl{black}
	\tl_set:Nn\l_pgfgo_goban_border_opacity_tl{1}
	\dim_new:N\l_pgfgo_goban_border_line_width_dim
	\dim_set:Nn\l_pgfgo_goban_border_line_width_dim{0.75pt}
	\tl_set:Nn\l_pgfgo_goban_border_fill_color_tl{white}
	\tl_set:Nn\l_pgfgo_goban_border_fill_opacity_tl{1}
	\dim_new:N\l_pgfgo_goban_border_rounded_corners_dim
	\dim_set:Nn\l_pgfgo_goban_border_rounded_corners_dim{1pt}


	%LABEL
	\tl_set:Nn\l_pgfgo_goban_labels_color_tl{black}
	\dim_new:N\l_pgfgo_goban_labels_sep_dim
	\dim_set:Nn\l_pgfgo_goban_labels_sep_dim{0.5em}
	\dim_new:N\l_pgfgo_goban_labels_font_size_dim
	\dim_set:Nn\l_pgfgo_goban_labels_font_size_dim{0.75em}
	\cs_set:Npn\l_pgfgo_goban_labels_font_cs:{\normalfont}
	\bool_set_false:N\l_pgfgo_goban_labels_pos_north_bool
	\bool_set_false:N\l_pgfgo_goban_labels_pos_east_bool
	\bool_set_false:N\l_pgfgo_goban_labels_pos_south_bool
	\bool_set_false:N\l_pgfgo_goban_labels_pos_west_bool


	%LAYERS
	\pgfdeclarelayer{pgfgo_layer_goban_border}
	\pgfdeclarelayer{pgfgo_layer_goban_grid}
	\pgfdeclarelayer{pgfgo_layer_goban_labels}
	\pgfdeclarelayer{pgfgo_layer_territory}
	\pgfdeclarelayer{pgfgo_layer_mark_shadow}
	\pgfdeclarelayer{pgfgo_layer_stone}
	\pgfdeclarelayer{pgfgo_layer_stone_mark}
	\pgfdeclarelayer{pgfgo_layer_mark}


	


	\keys_define:nn {pgfgo / goban}{
		new~remember					.code:n			= {
																			\seq_gclear:N\l_pgfgo_goban_elements_stack_seq
																			\bool_set_true:N\l_pgfgo_goban_remember_new_bool
																			\bool_set_true:N\l_pgfgo_goban_remember_add_bool
																			\pgfgo_goban_remember_all:
																		},

		remember				.code:n			= {
																			\bool_set_false:N\l_pgfgo_goban_remember_new_bool
																			\bool_set_true:N\l_pgfgo_goban_remember_add_bool
																			\pgfgo_goban_remember_all:
																		},

		forget								.code:n			= {
																			\bool_set_false:N\l_pgfgo_goban_remember_new_bool
																			\bool_set_false:N\l_pgfgo_goban_remember_add_bool
																			\pgfgo_goban_remember_nothing:
																		},

		resume						.code:n			= {\bool_set_true:N\l_pgfgo_goban_resume_bool},

		grid							.code:n 		= {\keys_set:nx{pgfgo / goban / grid}		{#1}},

		border						.code:n 		= {\keys_set:nx{pgfgo / goban / border} {#1}}, %DEPRECATED
		
		background						.code:n 		= {\keys_set:nx{pgfgo / goban / background} {#1}},

		label							.code:n 		= {\keys_set:nx{pgfgo / goban / label} {#1}},

		partial						.code:n 		= {	\bool_set_true:N\l_pgfgo_goban_partial_bool
																			\keys_set:nx{pgfgo / goban / partial} {#1}},

		scale							.tl_set:N		= \l_pgfgo_goban_scale_tl,

		size							.code:n			= {\pgfgo_parse_goban_size:n{#1}},

		use~i					.bool_set:N = \l_pgfgo_use_i_bool,

		use~i					.default:n	= {true},

		unknown						.code:n			= {\pgfgo_parse_goban_size:V\l_keys_key_str},
		}



	\keys_define:nn {pgfgo / goban / grid}{
		false							.bool_set:N = \l_pgfgo_goban_grid_bool,
		false							.default:n = {false},
		
		line							.code:n = {\keys_set:nn {pgfgo / goban / grid / line} {#1}},
		
		x~sep							.dim_set:N = \l_pgfgo_goban_grid_x_sep_dim,

		y~sep							.dim_set:N = \l_pgfgo_goban_grid_y_sep_dim,

		sep								.code:n = {\keys_set:nn{pgfgo / goban / grid}{x~sep = #1, y~sep = #1}},
	}
	
	\keys_define:nn {pgfgo / goban / grid / line} {
		color				.tl_set:N = \l_pgfgo_goban_grid_color_tl,
		
		opacity			.tl_set:N = \l_pgfgo_goban_grid_opacity_tl,
		
		width				.dim_set:N = \l_pgfgo_goban_grid_line_width_dim,
	}
	

	

	\keys_define:nn {pgfgo / goban / background}{
		false							.bool_set:N = \l_pgfgo_goban_border_bool,
		false							.default:n = {false},

		sep								.dim_set:N = \l_pgfgo_goban_border_sep_dim,
		
		line							.code:n 	= {\keys_set:nn {pgfgo / goban / background / line} {#1}},
		
		fill							.code:n 	= {\keys_set:nn {pgfgo / goban / background / fill} {#1}},

		rounded~corners		.dim_set:N = \l_pgfgo_goban_border_rounded_corners_dim,
		
		drop~shadow				.code:n =	{\keys_set:nn {pgfgo / goban / background / drop~shadow} {#1}},
		drop~shadow				.default:n = {true},
	}
	
	\bool_new:N \l_pgfgo_goban_background_drop_shadow_bool
	\fp_new:N \l_pgfgo_goban_background_drop_shadow_angle_fp
	\dim_new:N \l_pgfgo_goban_background_drop_shadow_offset_dim
	\fp_new:N \l_pgfgo_goban_background_drop_shadow_opacity_fp
	\tl_new:N \l_pgfgo_goban_background_drop_shadow_color_tl
	
	
	
	\keys_define:nn {pgfgo / goban / background / drop~shadow} {
		true		.bool_set:N = \l_pgfgo_goban_background_drop_shadow_bool,
		true		.default:n = {true},
		
		false		.bool_set:N = \l_pgfgo_goban_background_drop_shadow_bool,
		false		.default:n = {false},
		
		angle		.fp_set:N = \l_pgfgo_goban_background_drop_shadow_angle_fp,
		angle		.initial:n = {-45},
		
		offset 	.dim_set:N = \l_pgfgo_goban_background_drop_shadow_offset_dim,
		offset	.initial:n = {1.5pt},
		
		opacity .fp_set:N = \l_pgfgo_goban_background_drop_shadow_opacity_fp,
		opacity	.initial:n = {0.5},
		
		color 	.tl_set:N = \l_pgfgo_goban_background_drop_shadow_color_tl,
		color		.initial:n = {black},
	}
	
	

%
%\keys_define:nn {pgfgo / goban / background / custom}{
%	source .tl_set:N  = ,
%	
%	scale 	.pf_set:N = ,
%	x~scale 	.pf_set:N = ,
%	y~scale 	.pf_set:N = ,
%	x~shift 	.pf_set:N = ,
%	y~shift 	.pf_set:N = ,
%}


\keys_define:nn {pgfgo / goban / background / line}{
	color				.tl_set:N = \l_pgfgo_goban_border_color_tl,
	
	opacity			.tl_set:N = \l_pgfgo_goban_border_opacity_tl,
	
	width				.dim_set:N = \l_pgfgo_goban_border_line_width_dim,
	
	false				.code:n = {\bool_set_false:N\l_pgfgo_goban_border_line_bool},
	true				.code:n = {\bool_set_true:N\l_pgfgo_goban_border_line_bool},
}





\keys_define:nn {pgfgo / goban / background / fill}{
	color				.tl_set:N = \l_pgfgo_goban_border_fill_color_tl,
	
	opacity			.tl_set:N = \l_pgfgo_goban_border_fill_opacity_tl,
	
	false				.code:n = {\bool_set_false:N\l_pgfgo_goban_border_fill_bool},
	true				.code:n = {\bool_set_true:N\l_pgfgo_goban_border_fill_bool},
}





	\keys_define:nn {pgfgo / goban / label} {
		false				.code:n 		= {	\bool_set_false:N\l_pgfgo_goban_labels_pos_north_bool
																\bool_set_false:N\l_pgfgo_goban_labels_pos_east_bool
																\bool_set_false:N\l_pgfgo_goban_labels_pos_south_bool
																\bool_set_false:N\l_pgfgo_goban_labels_pos_west_bool
															},

		text~color	.tl_set:N 	= \l_pgfgo_goban_labels_color_tl,

		sep					.dim_set:N = \l_pgfgo_goban_labels_sep_dim,

		font~size		.dim_set:N = \l_pgfgo_goban_labels_font_size_dim,

		at					.code:n = {\keys_set:nx{pgfgo / goban / label / at} {#1}},

		font				.code:n	= {\cs_set:Npn\l_pgfgo_goban_labels_font_cs:{#1}},%WIP
	}



	\keys_define:nn {pgfgo / goban / label / at} {
		all					.code:n = {
			\bool_set_true:N\l_pgfgo_goban_labels_pos_north_bool
			\bool_set_true:N\l_pgfgo_goban_labels_pos_east_bool
			\bool_set_true:N\l_pgfgo_goban_labels_pos_south_bool
			\bool_set_true:N\l_pgfgo_goban_labels_pos_west_bool
													},

		none					.code:n = {
			\bool_set_false:N\l_pgfgo_goban_labels_pos_north_bool
			\bool_set_false:N\l_pgfgo_goban_labels_pos_east_bool
			\bool_set_false:N\l_pgfgo_goban_labels_pos_south_bool
			\bool_set_false:N\l_pgfgo_goban_labels_pos_west_bool
		},

		north				.bool_set:N = \l_pgfgo_goban_labels_pos_north_bool,
		north				.default:n = {true},

		east				.bool_set:N = \l_pgfgo_goban_labels_pos_east_bool,
		east				.default:n = {true},

		south				.bool_set:N = \l_pgfgo_goban_labels_pos_south_bool,
		south				.default:n = {true},

		west				.bool_set:N = \l_pgfgo_goban_labels_pos_west_bool,
		west				.default:n = {true},

		above				.bool_set:N = \l_pgfgo_goban_labels_pos_north_bool,
		above				.default:n = {true},

		right				.bool_set:N = \l_pgfgo_goban_labels_pos_east_bool,
		right				.default:n = {true},

		below				.bool_set:N = \l_pgfgo_goban_labels_pos_south_bool,
		below				.default:n = {true},

		left				.bool_set:N = \l_pgfgo_goban_labels_pos_west_bool,
		left				.default:n = {true},
	}



	\keys_define:nn {pgfgo / goban / partial}{
		from				.code:n 	= {
			\pgfgo_parse_goban_partial_from:n{#1}

			\pgfgo_parse_coordinate:x {\l_temp_a_tl}
			\tl_set:Nx\l_pgfgo_goban_partial_from_x_int{\l_pgfgo_parsed_x_coordinate_tl}
			\tl_set:Nx\l_pgfgo_goban_partial_from_y_int{\l_pgfgo_parsed_y_coordinate_tl}

			\pgfgo_parse_coordinate:x {\l_temp_b_tl}
			\tl_set:Nx\l_pgfgo_goban_partial_to_x_int{\l_pgfgo_parsed_x_coordinate_tl}
			\tl_set:Nx\l_pgfgo_goban_partial_to_y_int{\l_pgfgo_parsed_y_coordinate_tl}
		},
		false							.bool_set:N = \l_pgfgo_goban_partial_bool,
		false							.default:n = {false},
	}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------goban-----------------------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\cs_generate_variant:Nn \__pgfgo_goban:nnn {nVV}
	\int_new:N\l_pgfgo_goban_labels_current_x_int


	\cs_new:Npn\__pgfgo_goban:nnn #1#2#3 {
		\group_begin:
		\pgfsetlayers{
			pgfgo_layer_goban_border,
			pgfgo_layer_goban_grid,
			pgfgo_layer_goban_labels,
			pgfgo_layer_territory,
			pgfgo_layer_mark_shadow,
			pgfgo_layer_stone,
			pgfgo_layer_stone_mark,
			pgfgo_layer_mark,
			main
		}

		%---------------------------------------------------

		\bool_if:NTF\l_pgfgo_goban_partial_bool{

			\tl_set:Nn\l_pgfgo_goban_from_x_tl{\int_min:nn{\l_pgfgo_goban_partial_from_x_int}{\l_pgfgo_goban_partial_to_x_int}}
			\tl_set:Nn\l_pgfgo_goban_from_y_tl{\int_min:nn{\l_pgfgo_goban_partial_from_y_int}{\l_pgfgo_goban_partial_to_y_int}}
			\tl_set:Nn\l_pgfgo_goban_to_x_tl{\int_max:nn{\l_pgfgo_goban_partial_from_x_int}{\l_pgfgo_goban_partial_to_x_int}}
			\tl_set:Nn\l_pgfgo_goban_to_y_tl{\int_max:nn{\l_pgfgo_goban_partial_from_y_int}{\l_pgfgo_goban_partial_to_y_int}}

		}{
			\tl_set:Nn\l_pgfgo_goban_to_x_tl{#2}
			\tl_set:Nn\l_pgfgo_goban_to_y_tl{#3}
		}

		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		%-----------------TIKZ PICTURE---------------------%
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

		\tikzpicture
		\pgfsetxvec{\pgfpoint{ \l_pgfgo_goban_grid_x_sep_dim}{0}}
		\pgfsetyvec{\pgfpoint{0}{ \l_pgfgo_goban_grid_y_sep_dim}}
		\pgftransformscale{\l_pgfgo_goban_scale_tl}

		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		%----------------BORDER AND FILL-------------------%
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

		\pgfonlayer{pgfgo_layer_goban_border}
		\bool_if:NT\l_pgfgo_goban_border_bool{
			\pgfscope
				\pgfsetlinewidth{\l_pgfgo_goban_border_line_width_dim}
				\pgfsetstrokecolor{\l_pgfgo_goban_border_color_tl}
				\pgfsetstrokeopacity{\l_pgfgo_goban_border_opacity_tl}
				\pgfsetfillcolor{\l_pgfgo_goban_border_fill_color_tl}
				\pgfsetfillopacity{\l_pgfgo_goban_border_fill_opacity_tl}
				
				\pgfsetcornersarced{\pgfpoint{\l_pgfgo_goban_border_rounded_corners_dim}{\l_pgfgo_goban_border_rounded_corners_dim}}
				
				%--------DROP SHADOW
				
				\bool_if:NT \l_pgfgo_goban_background_drop_shadow_bool {
					\pgfscope
						\pgftransformshift{\pgfpointpolar{\fp_to_decimal:N \l_pgfgo_goban_background_drop_shadow_angle_fp}{\l_pgfgo_goban_background_drop_shadow_offset_dim}}
						\pgfpathrectanglecorners{
							\pgfpointadd{
								\pgfpointxy{\l_pgfgo_goban_from_x_tl}{\l_pgfgo_goban_from_y_tl}}{
								\pgfpoint{-\l_pgfgo_goban_border_sep_dim}{-\l_pgfgo_goban_border_sep_dim}}}{
							\pgfpointadd{
								\pgfpointxy{\l_pgfgo_goban_to_x_tl}{\l_pgfgo_goban_to_y_tl}}{
								\pgfpoint{\l_pgfgo_goban_border_sep_dim}{\l_pgfgo_goban_border_sep_dim}}}
						\pgfsetfillcolor{\l_pgfgo_goban_background_drop_shadow_color_tl}
						\pgfsetfillopacity{\fp_to_decimal:N\l_pgfgo_goban_background_drop_shadow_opacity_fp}
						\pgfusepath{fill}
					\endpgfscope
				}
				%FONDO			
				\pgfpathrectanglecorners{
					\pgfpointadd{
						\pgfpointxy{\l_pgfgo_goban_from_x_tl}{\l_pgfgo_goban_from_y_tl}}{
						\pgfpoint{-\l_pgfgo_goban_border_sep_dim}{-\l_pgfgo_goban_border_sep_dim}}}{
					\pgfpointadd{
						\pgfpointxy{\l_pgfgo_goban_to_x_tl}{\l_pgfgo_goban_to_y_tl}}{
						\pgfpoint{\l_pgfgo_goban_border_sep_dim}{\l_pgfgo_goban_border_sep_dim}}}

				\pgfusepath{\bool_if:NT\l_pgfgo_goban_border_line_bool{stroke}, \bool_if:NT\l_pgfgo_goban_border_fill_bool{fill}}
			\endpgfscope
		}
		\endpgfonlayer


		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		%----------------------GRID------------------------%
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


		\pgfonlayer{pgfgo_layer_goban_grid}
		\pgfscope
		\bool_if:NT\l_pgfgo_goban_partial_bool{
			\pgfpathrectanglecorners{
				\pgfpointxy{\l_pgfgo_goban_from_x_tl-0.5}{\l_pgfgo_goban_from_y_tl-0.5}}{
				\pgfpointxy{\l_pgfgo_goban_to_x_tl+0.5}{\l_pgfgo_goban_to_y_tl+0.5}}

			\pgfusepath{clip}
		}

		\bool_if:NT\l_pgfgo_goban_grid_bool{
			\pgfscope
			\pgfsetstrokecolor{\l_pgfgo_goban_grid_color_tl}
			\pgfsetstrokeopacity{\l_pgfgo_goban_grid_opacity_tl}
			\pgfsetlinewidth{\l_pgfgo_goban_grid_line_width_dim}
			\pgfsetroundcap

			\pgfpathgrid[step = \pgfpointxy{1}{1}] {\pgfpointxy{1}{1}}{\pgfpointxy{#2}{#3}}

			\pgfusepath{stroke}
			\endpgfscope
		}
		\endpgfscope
		\endpgfonlayer

		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		%----------------------LABELS----------------------%
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


		\pgfonlayer{pgfgo_layer_goban_labels}
			\pgfscope
				\pgfsetcolor{\l_pgfgo_goban_labels_color_tl}

				\bool_if:NT\l_pgfgo_goban_labels_pos_north_bool{
					\foreach \x in {\l_pgfgo_goban_from_x_tl,...,\l_pgfgo_goban_to_x_tl}{
						\int_set:Nx\l_pgfgo_goban_labels_current_x_int{\x}
						\bool_if:NF\l_pgfgo_use_i_bool{
							\int_compare:nNnT{\l_pgfgo_goban_labels_current_x_int}>{8}{
								\int_incr:N\l_pgfgo_goban_labels_current_x_int
						}}

						\pgftext[at = \pgfpointadd{
							\pgfpointxy{\x}{\l_pgfgo_goban_to_y_tl}}{
							\pgfpoint{0}{\l_pgfgo_goban_labels_sep_dim + \l_pgfgo_players_stone_radius_dim + 0.5em}}
						]	{{\fontsize{\l_pgfgo_goban_labels_font_size_dim}{0pt}\selectfont
								\int_to_Alph:n{\l_pgfgo_goban_labels_current_x_int}
							}}}
				}

				\bool_if:NT\l_pgfgo_goban_labels_pos_east_bool{
					\foreach \y in {\l_pgfgo_goban_from_y_tl,...,\l_pgfgo_goban_to_y_tl}{
						\pgftext[at = \pgfpointadd{
							\pgfpointxy{\l_pgfgo_goban_to_x_tl}{\y}}{
							\pgfpoint{\l_pgfgo_goban_labels_sep_dim + \l_pgfgo_players_stone_radius_dim + 0.5em}{0}}
						]	{{\fontsize{\l_pgfgo_goban_labels_font_size_dim}{0pt}\selectfont\y}}}
				}

				\bool_if:NT\l_pgfgo_goban_labels_pos_south_bool{
					\foreach \x in {\l_pgfgo_goban_from_x_tl,...,\l_pgfgo_goban_to_x_tl}{
						\int_set:Nx\l_pgfgo_goban_labels_current_x_int{\x}
						\bool_if:NF\l_pgfgo_use_i_bool{
							\int_compare:nNnT{\l_pgfgo_goban_labels_current_x_int}>{8}{
								\int_incr:N\l_pgfgo_goban_labels_current_x_int
						}}

						\pgftext[at = \pgfpointadd{
							\pgfpointxy{\x}{\l_pgfgo_goban_from_y_tl}}{
							\pgfpoint{0}{-\l_pgfgo_goban_labels_sep_dim-\l_pgfgo_players_stone_radius_dim-0.5em}}
						]	{{\fontsize{\l_pgfgo_goban_labels_font_size_dim}{0pt}\selectfont
								\int_to_Alph:n{\l_pgfgo_goban_labels_current_x_int}
							}}}
				}

				\bool_if:NT\l_pgfgo_goban_labels_pos_west_bool{
					\foreach \y in {\l_pgfgo_goban_from_y_tl,...,\l_pgfgo_goban_to_y_tl}{
						\pgftext[at = \pgfpointadd{
							\pgfpointxy{\l_pgfgo_goban_from_x_tl}{\y}}{
							\pgfpoint{-\l_pgfgo_goban_labels_sep_dim-\l_pgfgo_players_stone_radius_dim-0.5em}{0}}
						]	{{\fontsize{\l_pgfgo_goban_labels_font_size_dim}{0pt}\selectfont\y}}}
				}
			\endpgfscope
		\endpgfonlayer



		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		%----------------------RESUME----------------------%
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

		\bool_if:NT\l_pgfgo_goban_resume_bool{
			\seq_map_inline:Nn \l_pgfgo_goban_elements_stack_seq {##1}}
	}



	\cs_new:Npn\__end_pgfgo_goban: {
		\endtikzpicture
		\group_end:
		\int_set:Nn\l_pgfgo_move_from_int{1}
	}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------------------------------LATEX------------------------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


	\NewDocumentEnvironment{goban}{O{}}{
		\keys_set:nn {pgfgo / goban} {#1}

		\__pgfgo_goban:nVV{}{\l_pgfgo_goban_to_x_tl}{\l_pgfgo_goban_to_y_tl}
		}{\__end_pgfgo_goban:}



\ExplSyntaxOff