Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal object AvatarContentDeriver {
private val ANONYMOUS_ANIMAL_NAMES: List<String> = LogoIconRegistry.ANONYMOUS_ANIMAL_ICONS.keys.sorted()

/**
* The 33 curated `anonymous_entity` keys, sorted, so a given seed always hashes to the same
* The 36 curated `anonymous_entity` keys, sorted, so a given seed always hashes to the same
* index regardless of map iteration order.
*/
private val ANONYMOUS_ENTITY_NAMES: List<String> = LogoIconRegistry.ANONYMOUS_ENTITY_ICONS.keys.sorted()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ internal object LogoIconRegistry {
"circuit_node" to R.drawable.logo_icon_entity_circuit_node,
"antenna" to R.drawable.logo_icon_entity_antenna,
"valve" to R.drawable.logo_icon_entity_valve,
"bot_head" to R.drawable.logo_icon_entity_bot_head,
"brain" to R.drawable.logo_icon_entity_brain,
"neural_net" to R.drawable.logo_icon_entity_neural_net,
)

@DrawableRes
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class AvatarContentDeriverTest {

@Test
fun `derives a deterministic anonymous_entity key from the seed`() {
// hashStr("Fox") == 70831 (see AvatarMathTest); 70831 mod 33 == 13, "key" in the sorted
// 33-name list.
assertEquals("key", AvatarContentDeriver.derive("Fox", AvatarVariant.ANONYMOUS_ENTITY))
// hashStr("Fox") == 70831 (see AvatarMathTest); 70831 mod 36 == 19, "obelisk" in the sorted
// 36-name list.
assertEquals("obelisk", AvatarContentDeriver.derive("Fox", AvatarVariant.ANONYMOUS_ENTITY))
assertEquals(
AvatarContentDeriver.derive("Fox", AvatarVariant.ANONYMOUS_ENTITY),
AvatarContentDeriver.derive("Fox", AvatarVariant.ANONYMOUS_ENTITY),
Expand Down
Loading