Class: TCLog::Round
- Inherits:
-
Object
- Object
- TCLog::Round
- Defined in:
- lib/tclog.rb
Instance Attribute Summary collapse
-
#map_name ⇒ Object
Next map name if this round changing map.
-
#round_number ⇒ Object
readonly
Round number at game.
-
#specops ⇒ Object
specops total scores.
-
#terrorists ⇒ Object
terrorists total scores.
-
#won ⇒ Object
Team which won this round.
Instance Method Summary collapse
-
#initialize(game, n, rn, win, map_changing = false, map_name = nil) ⇒ Round
constructor
:nodoc.
-
#map_changing=(x) ⇒ Object
:nodoc:.
-
#map_changing? ⇒ Boolean
Is this round changing map?.
-
#player_results ⇒ Object
Players result which joined at this round.
-
#players ⇒ Object
Players which joined at this round.
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_name ⇒ Object
Next map name if this round changing map.
148 149 150 |
# File 'lib/tclog.rb', line 148 def map_name @map_name end |
#round_number ⇒ Object (readonly)
Round number at game. (Counted without map changing)
160 161 162 |
# File 'lib/tclog.rb', line 160 def round_number @round_number end |
#specops ⇒ Object
specops total scores.
151 152 153 |
# File 'lib/tclog.rb', line 151 def specops @specops end |
#terrorists ⇒ Object
terrorists total scores.
154 155 156 |
# File 'lib/tclog.rb', line 154 def terrorists @terrorists end |
#won ⇒ Object
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?
143 |
# File 'lib/tclog.rb', line 143 def map_changing?; @map_changing; end |
#player_results ⇒ Object
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 |
#players ⇒ Object
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 |