Class: Frostbitten::BannedPlayer

Inherits:
Hashie::Trash
  • Object
show all
Defined in:
lib/frostbitten/player.rb

Class Method Summary collapse

Class Method Details

.players_from_list(list, index) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/frostbitten/player.rb', line 36

def players_from_list(list,index)
	list_count = list.slice!(index).to_i
	return [].tap do |players|
		list.slice!(index,list_count*5).each_slice(5) do |player_value|
			p = {}
			player_value.to_enum.with_index(1) { |val,index| p["data#{index}"] = val }
			players << BannedPlayer.new(p)
		end
	end
end