Generating Random Default Colors When Default Color List is Exhausted
-
I've a PR up for this already, but wanted to open a thread for discussion.
https://github.com/triplea-game/triplea/pull/7637
To describe what the engine does today, default players are defined today in
map.properties. If a game has a player that does not have a color defined inmap.propertiers, then that player gets a default color. There were about 8 default colors. When all default colors are used up, the game would crash on launch with ajava.util.NoSuchElementException.The update in PR#7637 essentially avoids this crash and instead when all of the default colors are used up, the engine will start generating random colors. Any given player name will always generate the same random color, so the colors will be consistent for any map even if randomly generated.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login