Created
October 25, 2018 17:51
-
-
Save MustaphaTR/53f02a865bdacdbd98f89e30a7c0e62b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Color color; | |
| if (!string.IsNullOrEmpty(romp.Terrain)) | |
| { | |
| color = tileset[tileset.GetTerrainIndex(romp.Terrain)].Color; | |
| } | |
| else if (romp.Color != null) | |
| { | |
| color = romp.Color.RGB; | |
| } | |
| else | |
| { | |
| var owner = PlayerDefinitions.Where(p => s.InitDict.Get<OwnerInit>().PlayerName == p.Value.Nodes.First(k => k.Key == "Name").Value.Value).First(); | |
| var colorValue = owner.Value.Nodes.Where(n => n.Key == "Color"); | |
| var ownerColor = colorValue.Any() ? colorValue.First().Value.Value : "FFFFFF"; | |
| HSLColor.TryParseRGB(ownerColor, out color); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment