Implements Exit Numbers + Names (junction:ref way tag for now)
This commit is contained in:
committed by
Patrick Niklaus
parent
6d78c11fd2
commit
7d900e3b5a
+13
-5
@@ -37,7 +37,7 @@ StringView NameTable::GetNameForID(const NameID id) const
|
||||
if (id == INVALID_NAMEID)
|
||||
return {};
|
||||
|
||||
return m_name_table.at(id);
|
||||
return m_name_table.at(id + 0);
|
||||
}
|
||||
|
||||
StringView NameTable::GetDestinationsForID(const NameID id) const
|
||||
@@ -48,6 +48,14 @@ StringView NameTable::GetDestinationsForID(const NameID id) const
|
||||
return m_name_table.at(id + 1);
|
||||
}
|
||||
|
||||
StringView NameTable::GetExitsForID(const NameID id) const
|
||||
{
|
||||
if (id == INVALID_NAMEID)
|
||||
return {};
|
||||
|
||||
return m_name_table.at(id + 4);
|
||||
}
|
||||
|
||||
StringView NameTable::GetRefForID(const NameID id) const
|
||||
{
|
||||
if (id == INVALID_NAMEID)
|
||||
@@ -55,14 +63,14 @@ StringView NameTable::GetRefForID(const NameID id) const
|
||||
|
||||
// Way string data is stored in blocks based on `id` as follows:
|
||||
//
|
||||
// | name | destination | pronunciation | ref |
|
||||
// | name | destination | pronunciation | ref | exits
|
||||
// ^ ^
|
||||
// [range)
|
||||
// ^ id + 3
|
||||
//
|
||||
// `id + offset` gives us the range of chars.
|
||||
//
|
||||
// Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref.
|
||||
// Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref, 4 is exits
|
||||
// See datafacades and extractor callbacks for details.
|
||||
const constexpr auto OFFSET_REF = 3u;
|
||||
return m_name_table.at(id + OFFSET_REF);
|
||||
@@ -75,14 +83,14 @@ StringView NameTable::GetPronunciationForID(const NameID id) const
|
||||
|
||||
// Way string data is stored in blocks based on `id` as follows:
|
||||
//
|
||||
// | name | destination | pronunciation | ref |
|
||||
// | name | destination | pronunciation | ref | exits
|
||||
// ^ ^
|
||||
// [range)
|
||||
// ^ id + 2
|
||||
//
|
||||
// `id + offset` gives us the range of chars.
|
||||
//
|
||||
// Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref.
|
||||
// Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref, 4 is exits
|
||||
// See datafacades and extractor callbacks for details.
|
||||
const constexpr auto OFFSET_PRONUNCIATION = 2u;
|
||||
return m_name_table.at(id + OFFSET_PRONUNCIATION);
|
||||
|
||||
Reference in New Issue
Block a user