// Called when a GameObject is dropped on a profession area // Returns false if the dropped object is not a person. public bool OnChangeProfession(GameObject uiObject, PersonAttribute newProfession) { if (!mUiPeopleMap.ContainsValue(uiObject)) { return(false); } mUiPeopleMap.GetKey(uiObject).ChangeProfession(newProfession); return(true); }
private static string GetAccessibilityModifiersRequiredEditorConfigString(CodeStyleOption <AccessibilityModifiersRequired> option) { // If they provide 'never', they don't need a notification level. if (option.Notification == null) { Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(AccessibilityModifiersRequired.Never)); return(s_accessibilityModifiersRequiredMap.GetKeyOrDefault(AccessibilityModifiersRequired.Never)); } Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); return($"{s_accessibilityModifiersRequiredMap.GetKeyOrDefault(option.Value)}:{option.Notification.ToEditorConfigString()}"); }
private static string GetUnusedExpressionAssignmentPreferenceEditorConfigString(CodeStyleOption <UnusedValuePreference> option, UnusedValuePreference defaultPreference) { Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value)); var value = s_unusedExpressionAssignmentPreferenceMap.GetKeyOrDefault(option.Value) ?? s_unusedExpressionAssignmentPreferenceMap.GetKeyOrDefault(defaultPreference); return(option.Notification == null ? value : $"{value}:{option.Notification.ToEditorConfigString()}"); }
private static string GetParenthesesPreferenceEditorConfigString(CodeStyleOption <ParenthesesPreference> option) { Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); var value = s_parenthesesPreferenceMap.GetKeyOrDefault(option.Value) ?? s_parenthesesPreferenceMap.GetKeyOrDefault(ParenthesesPreference.AlwaysForClarity); return(option.Notification == null ? value : $"{value}:{option.Notification.ToEditorConfigString()}"); }
private static Option <bool> CreateSpaceWithinParenthesesOption(SpacingWithinParenthesesOption parenthesesOption, string name) { var option = CreateOption( CSharpFormattingOptionGroups.Spacing, name, defaultValue: false, storageLocations: new OptionStorageLocation[] { new EditorConfigStorageLocation <bool>( "csharp_space_between_parentheses", s => DetermineIfSpaceOptionIsSet(s, parenthesesOption), GetSpacingWithParenthesesEditorConfigString), new RoamingProfileStorageLocation($"TextEditor.CSharp.Specific.{name}") }); Debug.Assert(s_spacingWithinParenthesisOptionsEditorConfigMap.ContainsValue(parenthesesOption)); s_spacingWithinParenthesisOptionsMapBuilder.Add(option, parenthesesOption); return(option); }
private static Option <bool> CreateNewLineForBracesOption(NewLineOption newLineOption, string name) { var option = CreateOption( CSharpFormattingOptionGroups.NewLine, name, defaultValue: true, storageLocations: new OptionStorageLocation[] { new EditorConfigStorageLocation <bool>( "csharp_new_line_before_open_brace", value => DetermineIfNewLineOptionIsSet(value, newLineOption), GetNewLineOptionEditorConfigString), new RoamingProfileStorageLocation($"TextEditor.CSharp.Specific.{name}") }); Debug.Assert(s_newLineOptionsEditorConfigMap.ContainsValue(newLineOption)); s_newLineOptionsMapBuilder.Add(option, newLineOption); return(option); }