Simple string-to-string map (dictionary) allows to store and retrieve key-value string pairs.
Extra feature: get serialized dictionary as a string, so the user can store it in a CVar. So this Dictionary can be used between games.
There are several mods in need of this data structure (Weapon Menu, Lazy Points, Target Spy). Maybe FragTrak could use it too.
PR: https://github.com/coelckers/gzdoom/pull/999
PS. It's no way I got everything right in unfamiliar code, so I'm ready to fix any issues.
export TMap<FString, FString> to ZScript as Dictionary
Moderator: GZDoom Developers
- Player701
-
- Posts: 1710
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: export TMap<FString, FString> to ZScript as Dictionary
I could really use a generic Dictionary<TKey, TValue> like in .NET. Too bad ZScript does not have generic types...
However, this particular one will probably come in handy as well. Thank you.
However, this particular one will probably come in handy as well. Thank you.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: export TMap<FString, FString> to ZScript as Dictionary
I am not a fan of such generic containers. At work I have to deal with a project which used these for all data storage. The result: It's impossible to track content because no error triggers the compiler's syntax check, it's all dictionaries with a wild mixture of object types in them. Refactoring that stuff to something robust is a nightmare and I very much prefer not to see that in GZDoom ever.