indexing
	description: "Item das die Daten eines Battle.net-Servers Darstellt"
	author: "Daniel Jacobi"
	date: "$Date: 2003/10/04 21:48:57 $"
	revision: "$Revision: 1.3 $"

class
	BNET_SERVER

create
	make,
	make_with_values

feature {NONE} -- Initialization

	make is
			-- Initialize `Current'.
		do
			name := ""
			zone := 0
			url := ""
		end

	make_with_values(a_name: STRING; a_zone: INTEGER; a_url:  STRING;) is
			-- Initialize `Current'.
		require
			name_not_void: a_name /= void
			url_not_void: a_url /= Void
			lower_range: a_zone > -13
			upper_range: a_zone < 13
		do
			name := a_name
			zone := a_zone
			url := a_url
		ensure
			
		end

feature -- Access

	get_name: STRING is
			-- Return `name'-value
		do
			Result := name
		end
		
	get_zone: INTEGER is
			-- Return `zone'-value
		do
			Result := zone
		end
		
	get_url: STRING is
			-- Return `url'-value
		do
			Result := url
		end

feature -- Element change

	set_name(a_name : STRING) is
			-- set `name'-value
		require
			name_not_void: a_name /= Void
		do
			name := a_name
		ensure
			new_name: equal(name, a_name)
		end
		
	set_zone(a_zone: INTEGER) is
			-- set `zone'-value
		require
			lower_range: a_zone > -13
			upper_range: a_zone < 13
		do
			zone := a_zone
		ensure
			new_zone: equal(zone, a_zone)
		end
		
	set_url(a_url: STRING) is
			-- set `url'-value
		require
			url_not_void: a_url /= Void
		do
			url := a_url
		ensure
			new_url: equal(url, a_url)
		end

feature -- Conversion

	to_bnet_string: STRING is
			-- Converts to bnet-structured string
		do
			create Result.make_empty
			Result.append_string("%U")
			Result.append_string(url)
			Result.append_string("%U")
			Result.append_integer(zone)
			Result.append_string("%U")
			Result.append_string(name)
		end

feature {NONE} -- Implementation

	name: STRING
	
	zone: INTEGER
	
	url: STRING

end -- class BNET_SERVER
