src/yapf/yapf_node_rail.hpp
changeset 7616 2591c712d243
parent 7615 42bf748ad323
child 10429 1b99254f9607
equal deleted inserted replaced
7615:42bf748ad323 7616:2591c712d243
    12 
    12 
    13 	FORCEINLINE CYapfRailSegmentKey(const CYapfRailSegmentKey& src) : m_value(src.m_value) {}
    13 	FORCEINLINE CYapfRailSegmentKey(const CYapfRailSegmentKey& src) : m_value(src.m_value) {}
    14 	FORCEINLINE CYapfRailSegmentKey(const CYapfNodeKeyTrackDir& node_key) {Set(node_key);}
    14 	FORCEINLINE CYapfRailSegmentKey(const CYapfNodeKeyTrackDir& node_key) {Set(node_key);}
    15 
    15 
    16 	FORCEINLINE void Set(const CYapfRailSegmentKey& src) {m_value = src.m_value;}
    16 	FORCEINLINE void Set(const CYapfRailSegmentKey& src) {m_value = src.m_value;}
    17 	FORCEINLINE void Set(const CYapfNodeKeyTrackDir& node_key) {m_value = (((int)node_key.m_tile) << 3) | node_key.m_td;}
    17 	FORCEINLINE void Set(const CYapfNodeKeyTrackDir& node_key) {m_value = (((int)node_key.m_tile) << 4) | node_key.m_td;}
    18 
    18 
    19 	FORCEINLINE int32 CalcHash() const {return m_value;}
    19 	FORCEINLINE int32 CalcHash() const {return m_value;}
    20 	FORCEINLINE TileIndex GetTile() const {return (TileIndex)(m_value >> 3);}
    20 	FORCEINLINE TileIndex GetTile() const {return (TileIndex)(m_value >> 4);}
       
    21 	FORCEINLINE Trackdir GetTrackdir() const {return (Trackdir)(m_value & 0x0F);}
    21 	FORCEINLINE bool operator == (const CYapfRailSegmentKey& other) const {return m_value == other.m_value;}
    22 	FORCEINLINE bool operator == (const CYapfRailSegmentKey& other) const {return m_value == other.m_value;}
    22 
    23 
    23 	void Dump(DumpTarget &dmp) const
    24 	void Dump(DumpTarget &dmp) const
    24 	{
    25 	{
    25 		dmp.WriteTile("tile", GetTile());
    26 		dmp.WriteTile("tile", GetTile());