Sha256: 1349f23b93f633eb5a5f43fdb1230e6be5f50498d0661ab15f6ba73189bcda9f
Contents?: true
Size: 863 Bytes
Versions: 66
Compression:
Stored size: 863 Bytes
Contents
class Player PLAYER_CLASSES = { 'sco' => 'scout', 'sni' => 'sniper', 'sol' => 'soldier', 'dem' => 'demoman', 'med' => 'medic', 'pyr' => 'pyro', 'hwg' => 'hwguy', 'spy' => 'spy', 'eng' => 'engineer' }.freeze def initialize(data) @data = data end def name @data['name'] end def score @data['score'] end def to_row "#{emoji}#{name}" end def team return 'spec' if !valid_score? || @data['team'].empty? || @data['team'] == 'observe' @data['team'] end def player_class short_class && PLAYER_CLASSES[short_class] end private def emoji Emoji.for(team: team.to_s, player_class: player_class) end def short_class skin.split('_').last && skin.split('_').last[0, 3] end def skin @data['skin'] end def valid_score? score != -9999 end end
Version data entries
66 entries across 66 versions & 1 rubygems