C# Unity 字典或其他

huangapple go评论60阅读模式
英文:

C# Unity Dictionary or else

问题

我正在使用Unity制作一个游戏,我将在其中使用牛津5000个英语单词及其翻译到我的母语,并创建一个专注于教授非母语人士英语单词的游戏。

我计划使用两个字典,每个字典包含5000个单词,每个单词都将有一个与其翻译匹配的ID。这种方法正确吗?在一个字典中拥有5000个数据是否可以?

两个庞大的字典可以吗?

英文:

I'am making a game with unity where I will use Oxford 5000 english words and the translations in my native language and create a game focused on teaching english words to non native speakers.

I'am planning on using 2 Dictionaries each containing 5k words every word will have an ID which match the ID of their translation, Is this a correct approach? Is it ok to have 5k data in a single Dictionary?

2 Huge Dictionaries is it okay?

答案1

得分: 2

根据你所说的“好”是什么意思而定。

如果你在问是否会导致程序崩溃,不会的。它会正常运行。

但至少,我建议将这两个词存储在自定义的结构体/类中,这样你不会不必要地在两个字典中重复键。

就像大多数编程一样,最好的答案是尝试一下。如果不起作用,就修复它。

英文:

It depends what you mean by "okay".

If you're asking if that will crash the program, no, it won't. It will work.

But at the very least, I'd recommend keeping both words in a custom struct/class so you're not duplicating the keys in two dictionaries needlessly.

As with most programming, though, the best answer is to try it out. And if it doesn't work, fix it.

huangapple
  • 本文由 发表于 2023年2月14日 02:32:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75439922.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定