make accessors const, add comments
This commit is contained in:
@@ -62,6 +62,9 @@ struct ExtractionWay
|
||||
bidirectional,
|
||||
opposite };
|
||||
|
||||
// These accessor methods exists to support the depreciated "way.direction" access
|
||||
// in LUA. Since the direction attribute was removed from ExtractionWay, the
|
||||
// accessors translate to/from the mode attributes.
|
||||
inline void set_direction(const Directions m)
|
||||
{
|
||||
if (Directions::oneway == m)
|
||||
@@ -81,7 +84,7 @@ struct ExtractionWay
|
||||
}
|
||||
}
|
||||
|
||||
inline const Directions get_direction()
|
||||
inline const Directions get_direction() const
|
||||
{
|
||||
if (TRAVEL_MODE_INACCESSIBLE != forward_travel_mode && TRAVEL_MODE_INACCESSIBLE != backward_travel_mode)
|
||||
{
|
||||
@@ -101,10 +104,12 @@ struct ExtractionWay
|
||||
}
|
||||
}
|
||||
|
||||
// These accessors exists because it's not possible to take the address of a bitfield,
|
||||
// and LUA therefore cannot read/write the mode attributes directly.
|
||||
inline void set_forward_mode(const TravelMode m) { forward_travel_mode = m; }
|
||||
inline const TravelMode get_forward_mode() { return forward_travel_mode; }
|
||||
inline const TravelMode get_forward_mode() const { return forward_travel_mode; }
|
||||
inline void set_backward_mode(const TravelMode m) { backward_travel_mode = m; }
|
||||
inline const TravelMode get_backward_mode() { return backward_travel_mode; }
|
||||
inline const TravelMode get_backward_mode() const { return backward_travel_mode; }
|
||||
|
||||
unsigned id;
|
||||
unsigned nameID;
|
||||
|
||||
Reference in New Issue
Block a user