Class: TCLog::Round

Inherits:
Object
  • Object
show all
Defined in:
lib/tclog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game, n, rn, win, map_changing = false, map_name = nil) ⇒ Round

:nodoc



116
117
118
119
120
121
122
123
124
125
# File 'lib/tclog.rb', line 116

def initialize(game, n, rn, win, map_changing = false, map_name = nil) # :nodoc
  @game = game
  @won = win
  @round_number = n
  @real_round_number = rn
  @map_changing = map_changing
  @specops = {}
  @terrorists = {}
  @map_name = map_name
end

Instance Attribute Details

#map_nameObject

Next map name if this round changing map.



148
149
150
# File 'lib/tclog.rb', line 148

def map_name
  @map_name
end

#round_numberObject (readonly)

Round number at game. (Counted without map changing)



160
161
162
# File 'lib/tclog.rb', line 160

def round_number
  @round_number
end

#specopsObject

specops total scores.



151
152
153
# File 'lib/tclog.rb', line 151

def specops
  @specops
end

#terroristsObject

terrorists total scores.



154
155
156
# File 'lib/tclog.rb', line 154

def terrorists
  @terrorists
end

#wonObject

Team which won this round.



157
158
159
# File 'lib/tclog.rb', line 157

def won
  @won
end

Instance Method Details

#map_changing=(x) ⇒ Object

:nodoc:



145
# File 'lib/tclog.rb', line 145

def map_changing=(x); @map_changing = x; end

#map_changing?Boolean

Is this round changing map?

Returns:

  • (Boolean)


143
# File 'lib/tclog.rb', line 143

def map_changing?; @map_changing;        end

#player_resultsObject

Players result which joined at this round.



136
137
138
139
140
# File 'lib/tclog.rb', line 136

def player_results
  @game.players.map do |g|
    g.results[@real_round_number] if @round_number
  end.compact
end

#playersObject

Players which joined at this round.



129
130
131
132
133
# File 'lib/tclog.rb', line 129

def players
  @game.players.map do |g|
    g if @round_number && g.results[@real_round_number]
  end.compact
end