feat: westworldwithwoman. add elsa
This commit is contained in:
1 parent
2764849943
commit
0e7482e04c
28 files changed
+1946
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package westworldwithwoman
|
||||
|
||||
import "fmt"
|
||||
|
||||
// entityNames is a temporary stand-in for the book's real name
|
||||
// lookup table. We still haven't been shown that table, so this is
|
||||
// just a small map we're filling in by hand as we meet entities -
|
||||
// the miner (ID 1) and now his wife Elsa (ID 2).
|
||||
var entityNames = map[int]string{
|
||||
1: "Miner Bob",
|
||||
2: "Elsa",
|
||||
}
|
||||
|
||||
// GetNameOfEntity looks up a friendly name for a given entity ID.
|
||||
// Anything not in entityNames falls back to printing the raw ID.
|
||||
func GetNameOfEntity(id int) string {
|
||||
if name, ok := entityNames[id]; ok {
|
||||
return name
|
||||
}
|
||||
return fmt.Sprintf("Entity %d", id)
|
||||
}
|
||||
Reference in new issue
Block a user