Class: SRL::Race::Entrant

Inherits:
Object
  • Object
show all
Includes:
Unmarshalable
Defined in:
lib/srl/typedefs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Unmarshalable

included

Instance Attribute Details

#displaynameObject (readonly) Also known as: name

This entrant’s player name.



130
131
132
# File 'lib/srl/typedefs.rb', line 130

def displayname
  @displayname
end

#messageObject (readonly) Also known as: comment

The comment entered by this entrant for this race, if applicable.



142
143
144
# File 'lib/srl/typedefs.rb', line 142

def message
  @message
end

#placeObject (readonly) Also known as: position

The position that this entrant finished this race in.



137
138
139
# File 'lib/srl/typedefs.rb', line 137

def place
  @place
end

#statetextObject (readonly)

The state of this entrant in the race. Is he ready, finished, neither?

FIXME

Switch to an enum-like implementation with symbols.



161
162
163
# File 'lib/srl/typedefs.rb', line 161

def statetext
  @statetext
end

#timeObject (readonly)

The number of seconds that this entrant took to complete the race goal.

Notes

A time of -1 indicates a forfeit.



150
151
152
# File 'lib/srl/typedefs.rb', line 150

def time
  @time
end

#twitchObject (readonly)

This entrant’s Twitch account name.



134
135
136
# File 'lib/srl/typedefs.rb', line 134

def twitch
  @twitch
end

Instance Method Details

#forfeit?Boolean

Did this entrant forfeit the race?

Returns:

  • (Boolean)


153
154
155
# File 'lib/srl/typedefs.rb', line 153

def forfeit?
  time == -1
end