Replies: 1 comment 3 replies
-
Hey there, jinxes = new Map(
jinxesJSON.map(({ id, hatred }) => [
clean(id),
new Map(hatred.map(({ id, reason }) => [clean(id), reason]))
])
); As you can see, they are turned into a 2 dimensional collection of Maps: Map(first character ID, Map(second character ID, reason)). This means you can access Jinxes like so: |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Actually, each jinx has two arguments:
But I was thinking about adding some other arguments to them:
I was trying to add the argument "reminder", and it didn't work.
If I understood correctly, it is because the jinxes are Maps (and so, "second" is the key, while "reason" is the value for this key, which explains why jinxes cannot have more than two arguments).
To be honest, for the reminder, I find another solution, by complexioning a little the argument "reason". But even if it works, it is less readable as a solution with a new argument. And I never had this issue while trying to add arguments in the role.
So, did I understand the issue correctly? If yes, the jinxes are saved as Maps, but then how are saved the roles? And isn't it possible to edit the format of the jinxes to use the same format?
Beta Was this translation helpful? Give feedback.
All reactions