public Neocom(MemoryStruct.INeocom raw) { this.Raw = raw; if (null == raw) { return; } var ButtonWithTexturePathMatch = new Func <string, MemoryStruct.IUIElement>(texturePathRegexPattern => raw?.Button?.FirstOrDefault(candidate => candidate?.TexturePath?.RegexMatchSuccess(texturePathRegexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false)); PeopleAndPlacesButton = ButtonWithTexturePathMatch("peopleandplaces"); ChatButton = ButtonWithTexturePathMatch("chat"); MailButton = ButtonWithTexturePathMatch("mail"); FittingButton = ButtonWithTexturePathMatch("fitting"); InventoryButton = ButtonWithTexturePathMatch("items"); MarketButton = ButtonWithTexturePathMatch("market"); WalletButton = ButtonWithTexturePathMatch("wallet"); }
static public INeocom Parse(this MemoryStruct.INeocom neocom) => null == neocom ? null : new Neocom(neocom);