indexing description: "[ Information about connected player and its state ]" date: "$Date$" revision: "$Revision$" class BB_MP_PLAYER_INFO create make feature -- Initialization make (a_player_name, an_ip_port_string: STRING; a_score:INTEGER) is -- create `Current' do set_player_name (a_player_name) set_ip_port_string (an_ip_port_string) set_score (a_score) end feature -- Status report player_name: STRING -- players name ip_port_string: STRING -- host_ip_port as string score: INTEGER -- players score remaining_blocks: INTEGER -- remaining destroyable blocks number_of_wins: INTEGER -- number of games this player has won lifes: INTEGER -- number of lifes feature -- Status setting set_score (a_score: INTEGER) is -- set `score' do score := a_score ensure value_set: score = a_score end set_player_name (a_string: STRING) is -- set `player_name' do player_name := a_string.out ensure value_set: player_name.is_equal (a_string) end set_ip_port_string (a_string: STRING) is -- set `ip_port_string' do ip_port_string := a_string.out ensure value_set: ip_port_string.is_equal (a_string) end set_remaining_blocks (an_integer: INTEGER) is -- set `remaining_blocks' do remaining_blocks := an_integer ensure value_set: remaining_blocks = an_integer end set_number_of_wins (an_integer: INTEGER) is -- set `number_of_wins' do number_of_wins := an_integer ensure value_set: number_of_wins = an_integer end set_lifes(an_integer: INTEGER) is -- set `lifes' do lifes := an_integer ensure value_set: lifes = an_integer end feature -- Access swap_values (other: like Current) is -- swaps content of `other' and `Current' local temp_int: INTEGER temp_string: STRING do temp_int := score set_score (other.score) other.set_score (temp_int) temp_int := remaining_blocks set_remaining_blocks (other.remaining_blocks) other.set_remaining_blocks (temp_int) temp_int := number_of_wins set_number_of_wins (other.number_of_wins) other.set_number_of_wins (temp_int) temp_int := lifes set_lifes (other.lifes) other.set_lifes (temp_int) temp_string := player_name.out set_player_name (other.player_name) other.set_player_name (temp_string) temp_string := ip_port_string.out set_ip_port_string (other.ip_port_string) other.set_ip_port_string (temp_string) end end