 windows(initialize):- 
	zone_surf_w(1).

zone_surf_w(_Surface) :-
	curr_zone(_Zone_number),
	load_z_surface_w(_Zone_number,_Surface),
	asserta(z_surface_w(_Zone_number,_Surface)),
	uset(z_surface_w,_Zone_number,_Surface).

load_z_surface_w(_Zone_number,_Surface):-
	tell_usr(zone_surf_w, _Surface),
	repeat, gen_integer(_N, 1), (
	load_x_off_w(_Zone_number, _Surface, _N),
	load_z_off_w(_Zone_number, _Surface, _N),
	load_wind_wth(_Zone_number,_Surface, _N),
	load_wind_ht(_Zone_number, _Surface, _N)
	),_N = 5,!.
	



'x_off_w$'(_N,_Xoffset) :-
 	curr_zone(_Current_zone),
	z_surface_w(_Current_zone,_Surface),
	assert(x_offset_wind(_Current_zone,_Surface,_N,_Xoffset)),
	uset(x_offset_wind,[_Current_zone,_Surface,_N],_Xoffset).

load_x_off_w(_Zone_number,_Surface,_N):-
	x_offset_wind(_Zone_number,_Surface,_N,_Xoffset),!,
	tell_usr(['x_off_w$', _N], _Xoffset);
	tell_usr(['x_off_w$', _N], 0).


'z_off_w$'(_N,_Zoffset) :-
 	curr_zone(_Current_zone),
	z_surface_w(_Current_zone,_Surface),
	assert(z_offset_wind(_Current_zone,_Surface,_N,_Zoffset)),
	uset(z_offset_wind,[_Current_zone,_Surface,_N],_Zoffset).

load_z_off_w(_Zone_number,_Surface,_N):-
	z_offset_wind(_Zone_number,_Surface,_N,_Zoffset),!,
	tell_usr(['z_off_w$', _N], _Zoffset);
	tell_usr(['z_off_w$', _N], 0).


'wind_wth$'(_N,_Width) :-
	curr_zone(_Current_zone),
	z_surface_w(_Current_zone,_Surface),
	assert(window_width(_Current_zone,_Surface,_N,_Width)),
	uset(window_width,[_Current_zone,_Surface,_N],_Width).

load_wind_wth(_Zone_number,_Surface,_N):-
	window_width(_Zone_number,_Surface,_N,_Width),!,
	tell_usr(['wind_wth$', _N], _Width);
	tell_usr(['wind_wth$', _N], 0).

'wind_ht$'(_N,_Height) :-
	curr_zone(_Current_zone),
	z_surface_w(_Current_zone,_Surface),
	assert(window_height(_Current_zone,_Surface,_N,_Height)),
	uset(window_height,[_Current_zone,_Surface,_N],_Height).

load_wind_ht(_Zone_number,_Surface,_N):-
	window_height(_Zone_number,_Surface,_N,_Height),!,
	tell_usr(['wind_ht$', _N], _Height);
	tell_usr(['wind_ht$', _N], 0).

