A game framework written with osu! in mind.

Apply outstanding inspections to framework (in line with osu!)

+1277 -1116
+94 -21
osu-framework.sln.DotSettings
··· 3 3 <s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Emp3/@EntryIndexedValue">True</s:Boolean> 4 4 <s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Epng/@EntryIndexedValue">True</s:Boolean> 5 5 <s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ewav/@EntryIndexedValue">True</s:Boolean> 6 + <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=2A66DD92_002DADB1_002D4994_002D89E2_002DC94E04ACDA0D_002Fd_003AMigrations/@EntryIndexedValue">ExplicitlyExcluded</s:String> 6 7 <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D9A367C9_002D4C1A_002D489F_002D9B05_002DA0CEA2B53B58/@EntryIndexedValue">ExplicitlyExcluded</s:String> 7 8 <s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String> 8 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeAccessorOwnerBody/@EntryIndexedValue">HINT</s:String> 9 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeAccessorOwnerBody/@EntryIndexedValue">WARNING</s:String> 10 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeMissingParentheses/@EntryIndexedValue">WARNING</s:String> 11 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeConstructorOrDestructorBody/@EntryIndexedValue">WARNING</s:String> 12 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeLocalFunctionBody/@EntryIndexedValue">HINT</s:String> 13 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeMethodOrOperatorBody/@EntryIndexedValue">HINT</s:String> 9 14 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeModifiersOrder/@EntryIndexedValue">WARNING</s:String> 10 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">WARNING</s:String> 15 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue"></s:String> 16 + <s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexRemoved">True</s:Boolean> 11 17 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeMemberModifiers/@EntryIndexedValue">WARNING</s:String> 12 18 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeModifiers/@EntryIndexedValue">WARNING</s:String> 13 19 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignedValueIsNeverUsed/@EntryIndexedValue">HINT</s:String> 14 20 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignNullToNotNullAttribute/@EntryIndexedValue">HINT</s:String> 15 21 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002EGlobal/@EntryIndexedValue">HINT</s:String> 16 22 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">HINT</s:String> 23 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadAttributeBracketsSpaces/@EntryIndexedValue">WARNING</s:String> 24 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadBracesSpaces/@EntryIndexedValue">WARNING</s:String> 25 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadChildStatementIndent/@EntryIndexedValue">WARNING</s:String> 26 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadColonSpaces/@EntryIndexedValue">WARNING</s:String> 27 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadCommaSpaces/@EntryIndexedValue">WARNING</s:String> 28 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadControlBracesIndent/@EntryIndexedValue">WARNING</s:String> 29 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadControlBracesLineBreaks/@EntryIndexedValue">WARNING</s:String> 30 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadDeclarationBracesIndent/@EntryIndexedValue">WARNING</s:String> 31 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadDeclarationBracesLineBreaks/@EntryIndexedValue">WARNING</s:String> 32 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadEmptyBracesLineBreaks/@EntryIndexedValue">WARNING</s:String> 33 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadExpressionBracesIndent/@EntryIndexedValue">WARNING</s:String> 34 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadExpressionBracesLineBreaks/@EntryIndexedValue">WARNING</s:String> 35 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadGenericBracketsSpaces/@EntryIndexedValue">WARNING</s:String> 36 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadIndent/@EntryIndexedValue">WARNING</s:String> 37 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadLinqLineBreaks/@EntryIndexedValue">WARNING</s:String> 38 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadListLineBreaks/@EntryIndexedValue">WARNING</s:String> 39 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadMemberAccessSpaces/@EntryIndexedValue">WARNING</s:String> 40 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadNamespaceBracesIndent/@EntryIndexedValue">WARNING</s:String> 41 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadParensLineBreaks/@EntryIndexedValue">WARNING</s:String> 42 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadParensSpaces/@EntryIndexedValue">WARNING</s:String> 43 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadPreprocessorIndent/@EntryIndexedValue">WARNING</s:String> 44 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadSemicolonSpaces/@EntryIndexedValue">WARNING</s:String> 45 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadSpacesAfterKeyword/@EntryIndexedValue">WARNING</s:String> 46 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadSquareBracketsSpaces/@EntryIndexedValue">WARNING</s:String> 47 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadSwitchBracesIndent/@EntryIndexedValue">WARNING</s:String> 48 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadSymbolSpaces/@EntryIndexedValue">WARNING</s:String> 17 49 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CanBeReplacedWithTryCastAndCheckForNull/@EntryIndexedValue">WARNING</s:String> 18 50 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckForReferenceEqualityInstead_002E1/@EntryIndexedValue">WARNING</s:String> 19 51 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckForReferenceEqualityInstead_002E2/@EntryIndexedValue">WARNING</s:String> 20 52 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002EGlobal/@EntryIndexedValue">HINT</s:String> 21 53 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002ELocal/@EntryIndexedValue">WARNING</s:String> 22 54 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassWithVirtualMembersNeverInherited_002EGlobal/@EntryIndexedValue">HINT</s:String> 55 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CollectionNeverQueried_002EGlobal/@EntryIndexedValue">SUGGESTION</s:String> 56 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CollectionNeverQueried_002ELocal/@EntryIndexedValue">HINT</s:String> 57 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue">HINT</s:String> 23 58 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CompareOfFloatsByEqualityOperator/@EntryIndexedValue">HINT</s:String> 24 59 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertClosureToMethodGroup/@EntryIndexedValue">WARNING</s:String> 25 60 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfDoToWhile/@EntryIndexedValue">WARNING</s:String> ··· 40 75 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> 41 76 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002ELocal/@EntryIndexedValue">WARNING</s:String> 42 77 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">HINT</s:String> 78 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue">HINT</s:String> 79 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ImpureMethodCallOnReadonlyValueField/@EntryIndexedValue">HINT</s:String> 43 80 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">ERROR</s:String> 81 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IncorrectBlankLinesNearBraces/@EntryIndexedValue">WARNING</s:String> 44 82 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InheritdocConsiderUsage/@EntryIndexedValue">HINT</s:String> 45 83 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InlineOutVariableDeclaration/@EntryIndexedValue">HINT</s:String> 46 84 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InvertIf/@EntryIndexedValue">HINT</s:String> ··· 55 93 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeConditionalExpression/@EntryIndexedValue">WARNING</s:String> 56 94 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeSequentialChecks/@EntryIndexedValue">WARNING</s:String> 57 95 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MethodSupportsCancellation/@EntryIndexedValue">WARNING</s:String> 96 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingBlankLines/@EntryIndexedValue">WARNING</s:String> 97 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingIndent/@EntryIndexedValue">WARNING</s:String> 98 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingLinebreak/@EntryIndexedValue">WARNING</s:String> 99 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingSpace/@EntryIndexedValue">WARNING</s:String> 58 100 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoreSpecificForeachVariableTypeAvailable/@EntryIndexedValue">WARNING</s:String> 101 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleSpaces/@EntryIndexedValue">WARNING</s:String> 102 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleStatementsOnOneLine/@EntryIndexedValue">WARNING</s:String> 103 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleTypeMembersOnOneLine/@EntryIndexedValue">WARNING</s:String> 59 104 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NestedStringInterpolation/@EntryIndexedValue">WARNING</s:String> 60 105 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002EGlobal/@EntryIndexedValue">HINT</s:String> 106 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=OutdentIsOffPrevLevel/@EntryIndexedValue">WARNING</s:String> 61 107 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">HINT</s:String> 62 108 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002EGlobal/@EntryIndexedValue">HINT</s:String> 63 109 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002ELocal/@EntryIndexedValue">HINT</s:String> ··· 65 111 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String> 66 112 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PrivateVariableCanBeMadeReadonly/@EntryIndexedValue">WARNING</s:String> 67 113 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String> 114 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentDefaultValue/@EntryIndexedValue">HINT</s:String> 68 115 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArrayCreationExpression/@EntryIndexedValue">WARNING</s:String> 69 116 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantAttributeParentheses/@EntryIndexedValue">WARNING</s:String> 70 117 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantAttributeUsageProperty/@EntryIndexedValue">WARNING</s:String> 118 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantBlankLines/@EntryIndexedValue">WARNING</s:String> 71 119 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCaseLabel/@EntryIndexedValue">HINT</s:String> 72 120 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String> 73 121 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String> 74 122 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String> 75 123 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue">WARNING</s:String> 76 - 124 + 77 125 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String> 78 126 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String> 79 127 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String> 80 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantTypeSpecificationInDefaultExpression/@EntryIndexedValue">WARNING</s:String> 128 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLinebreak/@EntryIndexedValue">WARNING</s:String> 129 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantSpace/@EntryIndexedValue">WARNING</s:String> 81 130 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantUsingDirective/@EntryIndexedValue">ERROR</s:String> 82 131 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantStringInterpolation/@EntryIndexedValue">WARNING</s:String> 83 132 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantVerbatimPrefix/@EntryIndexedValue">WARNING</s:String> ··· 122 171 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToAny/@EntryIndexedValue">WARNING</s:String> 123 172 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToCount/@EntryIndexedValue">WARNING</s:String> 124 173 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToFirst/@EntryIndexedValue">WARNING</s:String> 125 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToFirstOrDefault/@EntryIndexedValue">WARNING</s:String> 174 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToFirstOrDefault/@EntryIndexedValue">HINT</s:String> 126 175 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToLast/@EntryIndexedValue">WARNING</s:String> 127 176 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToLastOrDefault/@EntryIndexedValue">WARNING</s:String> 128 177 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleCallToSingle/@EntryIndexedValue">WARNING</s:String> ··· 131 180 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleOrDefault_002E2/@EntryIndexedValue">WARNING</s:String> 132 181 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleOrDefault_002E3/@EntryIndexedValue">WARNING</s:String> 133 182 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleOrDefault_002E4/@EntryIndexedValue">WARNING</s:String> 183 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SeparateControlTransferStatement/@EntryIndexedValue">WARNING</s:String> 184 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue">HINT</s:String> 134 185 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FBuiltInTypes/@EntryIndexedValue">DO_NOT_SHOW</s:String> 135 186 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FSimpleTypes/@EntryIndexedValue">DO_NOT_SHOW</s:String> 136 187 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SwitchStatementMissingSomeCases/@EntryIndexedValue">DO_NOT_SHOW</s:String> 137 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TooWideLocalVariableScope/@EntryIndexedValue">HINT</s:String> 188 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TabsAndSpacesMismatch/@EntryIndexedValue">WARNING</s:String> 189 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TabsAreDisallowed/@EntryIndexedValue">WARNING</s:String> 190 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TabsOutsideIndent/@EntryIndexedValue">WARNING</s:String> 191 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TooWideLocalVariableScope/@EntryIndexedValue">WARNING</s:String> 138 192 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TryCastAlwaysSucceeds/@EntryIndexedValue">WARNING</s:String> 139 193 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnassignedField_002EGlobal/@EntryIndexedValue">HINT</s:String> 140 194 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnnecessaryWhitespace/@EntryIndexedValue">WARNING</s:String> ··· 145 199 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002ELocal/@EntryIndexedValue">HINT</s:String> 146 200 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMethodReturnValue_002EGlobal/@EntryIndexedValue">HINT</s:String> 147 201 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMethodReturnValue_002ELocal/@EntryIndexedValue">HINT</s:String> 148 - 202 + 149 203 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameter_002EGlobal/@EntryIndexedValue">HINT</s:String> 150 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameter_002ELocal/@EntryIndexedValue">HINT</s:String> 151 204 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseCollectionCountProperty/@EntryIndexedValue">WARNING</s:String> 152 205 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseFormatSpecifierInFormatString/@EntryIndexedValue">WARNING</s:String> 153 206 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseFormatSpecifierInInterpolation/@EntryIndexedValue">WARNING</s:String> 154 207 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNameofExpression/@EntryIndexedValue">WARNING</s:String> 208 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNegatedPatternMatching/@EntryIndexedValue"></s:String> 209 + <s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNegatedPatternMatching/@EntryIndexRemoved">True</s:Boolean> 155 210 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNullPropagation/@EntryIndexedValue">WARNING</s:String> 156 211 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseObjectOrCollectionInitializer/@EntryIndexedValue">WARNING</s:String> 157 - <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UsePatternMatching/@EntryIndexedValue">HINT</s:String> 212 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UsePatternMatching/@EntryIndexedValue">WARNING</s:String> 158 213 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseStringInterpolation/@EntryIndexedValue">WARNING</s:String> 159 214 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VariableCanBeMadeConst/@EntryIndexedValue">WARNING</s:String> 160 215 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberCallInConstructor/@EntryIndexedValue">HINT</s:String> 161 216 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberNeverOverridden_002EGlobal/@EntryIndexedValue">HINT</s:String> 162 217 <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberNeverOverridden_002ELocal/@EntryIndexedValue">WARNING</s:String> 218 + <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=WrongIndentSize/@EntryIndexedValue">WARNING</s:String> 163 219 <s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Code_0020Cleanup_0020_0028peppy_0029/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="Code Cleanup (peppy)"&gt;&lt;CSArrangeThisQualifier&gt;True&lt;/CSArrangeThisQualifier&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_EXPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_EXPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_EXPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSUpdateFileHeader&gt;True&lt;/CSUpdateFileHeader&gt;&lt;CSCodeStyleAttributes ArrangeTypeAccessModifier="False" ArrangeTypeMemberAccessModifier="False" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="False" ArrangeBraces="False" ArrangeAttributes="False" ArrangeArgumentsStyle="False" /&gt;&lt;XAMLCollapseEmptyTags&gt;False&lt;/XAMLCollapseEmptyTags&gt;&lt;CSFixBuiltinTypeReferences&gt;True&lt;/CSFixBuiltinTypeReferences&gt;&lt;CSArrangeQualifiers&gt;True&lt;/CSArrangeQualifiers&gt;&lt;/Profile&gt;</s:String> 164 220 <s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Code Cleanup (peppy)</s:String> 221 + <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/LOCAL_FUNCTION_BODY/@EntryValue">ExpressionBody</s:String> 222 + <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/METHOD_OR_OPERATOR_BODY/@EntryValue">ExpressionBody</s:String> 223 + <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/USE_HEURISTICS_FOR_BODY_STYLE/@EntryValue">True</s:Boolean> 165 224 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_LINQ_QUERY/@EntryValue">True</s:Boolean> 166 225 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue">True</s:Boolean> 167 226 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue">True</s:Boolean> ··· 172 231 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_LIST/@EntryValue">True</s:Boolean> 173 232 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String> 174 233 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String> 234 + <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64> 235 + <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64> 175 236 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean> 176 237 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String> 177 238 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String> ··· 196 257 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GC/@EntryIndexedValue">GC</s:String> 197 258 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GL/@EntryIndexedValue">GL</s:String> 198 259 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GLSL/@EntryIndexedValue">GLSL</s:String> 199 - <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=2D/@EntryIndexedValue">2D</s:String> 200 - <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=3D/@EntryIndexedValue">3D</s:String> 201 260 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HID/@EntryIndexedValue">HID</s:String> 261 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HUD/@EntryIndexedValue">HUD</s:String> 202 262 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String> 203 - <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IOS/@EntryIndexedValue">IOS</s:String> 263 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IL/@EntryIndexedValue">IL</s:String> 204 264 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String> 205 265 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String> 206 266 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JIT/@EntryIndexedValue">JIT</s:String> ··· 208 268 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String> 209 269 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String> 210 270 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String> 271 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RGB/@EntryIndexedValue">RGB</s:String> 211 272 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RNG/@EntryIndexedValue">RNG</s:String> 212 273 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SHA/@EntryIndexedValue">SHA</s:String> 213 - <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RGB/@EntryIndexedValue">RGB</s:String> 214 274 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SRGB/@EntryIndexedValue">SRGB</s:String> 215 275 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TK/@EntryIndexedValue">TK</s:String> 276 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SS/@EntryIndexedValue">SS</s:String> 277 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PP/@EntryIndexedValue">PP</s:String> 278 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GMT/@EntryIndexedValue">GMT</s:String> 279 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String> 280 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String> 216 281 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String> 217 282 <s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean> 218 283 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String> ··· 789 854 { 790 855 $END$ 791 856 };</s:String> 792 - <s:Boolean x:Key="/Default/UserDictionary/Words/=Approximator/@EntryIndexedValue">True</s:Boolean> 857 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Beatmap/@EntryIndexedValue">True</s:Boolean> 858 + <s:Boolean x:Key="/Default/UserDictionary/Words/=beatmaps/@EntryIndexedValue">True</s:Boolean> 859 + <s:Boolean x:Key="/Default/UserDictionary/Words/=beatmap_0027s/@EntryIndexedValue">True</s:Boolean> 793 860 <s:Boolean x:Key="/Default/UserDictionary/Words/=bindable/@EntryIndexedValue">True</s:Boolean> 794 861 <s:Boolean x:Key="/Default/UserDictionary/Words/=Catmull/@EntryIndexedValue">True</s:Boolean> 795 - <s:Boolean x:Key="/Default/UserDictionary/Words/=drawables/@EntryIndexedValue">True</s:Boolean> 796 - <s:Boolean x:Key="/Default/UserDictionary/Words/=drawable_0027s/@EntryIndexedValue">True</s:Boolean> 797 - <s:Boolean x:Key="/Default/UserDictionary/Words/=Bindables/@EntryIndexedValue">True</s:Boolean> 798 - <s:Boolean x:Key="/Default/UserDictionary/Words/=filenames/@EntryIndexedValue">True</s:Boolean> 799 - <s:Boolean x:Key="/Default/UserDictionary/Words/=localisable/@EntryIndexedValue">True</s:Boolean> 800 - <s:Boolean x:Key="/Default/UserDictionary/Words/=Roboto/@EntryIndexedValue">True</s:Boolean> 801 - <s:Boolean x:Key="/Default/UserDictionary/Words/=shaders/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> 862 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Drawables/@EntryIndexedValue">True</s:Boolean> 863 + <s:Boolean x:Key="/Default/UserDictionary/Words/=gameplay/@EntryIndexedValue">True</s:Boolean> 864 + <s:Boolean x:Key="/Default/UserDictionary/Words/=hitobjects/@EntryIndexedValue">True</s:Boolean> 865 + <s:Boolean x:Key="/Default/UserDictionary/Words/=keymods/@EntryIndexedValue">True</s:Boolean> 866 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Kiai/@EntryIndexedValue">True</s:Boolean> 867 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Leaderboard/@EntryIndexedValue">True</s:Boolean> 868 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Leaderboards/@EntryIndexedValue">True</s:Boolean> 869 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Playfield/@EntryIndexedValue">True</s:Boolean> 870 + <s:Boolean x:Key="/Default/UserDictionary/Words/=resampler/@EntryIndexedValue">True</s:Boolean> 871 + <s:Boolean x:Key="/Default/UserDictionary/Words/=ruleset/@EntryIndexedValue">True</s:Boolean> 872 + <s:Boolean x:Key="/Default/UserDictionary/Words/=rulesets/@EntryIndexedValue">True</s:Boolean> 873 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Taiko/@EntryIndexedValue">True</s:Boolean> 874 + <s:Boolean x:Key="/Default/UserDictionary/Words/=Unranked/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
+1 -1
osu.Framework.Tests/IO/TestWebRequest.cs
··· 520 520 521 521 public int Delay 522 522 { 523 - get { return delay; } 523 + get => delay; 524 524 set 525 525 { 526 526 delay = value;
+1 -1
osu.Framework.Tests/Visual/Clocks/TestCaseClock.cs
··· 60 60 private readonly Box bg; 61 61 private readonly Box hand; 62 62 63 - public VisualClock(IClock clock, bool processFrames = false) 63 + public VisualClock(IClock clock) 64 64 { 65 65 this.clock = clock; 66 66
+1
osu.Framework.Tests/Visual/Containers/TestCaseCircularContainer.cs
··· 44 44 { 45 45 if (!firstUpdate) 46 46 return true; 47 + 47 48 firstUpdate = false; 48 49 49 50 return base.UpdateSubTree();
+416 -420
osu.Framework.Tests/Visual/Containers/TestCaseSizing.cs
··· 422 422 break; 423 423 424 424 case 8: 425 - { 426 - Container box1; 427 - Container box2; 428 - Container box3; 425 + { 426 + Container box1; 427 + Container box2; 428 + Container box3; 429 429 430 - testContainer.Add(new FillFlowContainer 430 + testContainer.Add(new FillFlowContainer 431 + { 432 + RelativeSizeAxes = Axes.Both, 433 + Children = new Drawable[] 431 434 { 432 - RelativeSizeAxes = Axes.Both, 433 - Children = new Drawable[] 435 + // This first guy is used for spacing. 436 + new Container 437 + { 438 + RelativeSizeAxes = Axes.Both, 439 + Size = new Vector2(0.125f, 1), 440 + }, 441 + new Container 434 442 { 435 - // This first guy is used for spacing. 436 - new Container 443 + RelativeSizeAxes = Axes.Both, 444 + Size = new Vector2(0.25f, 1), 445 + Children = new[] 437 446 { 438 - RelativeSizeAxes = Axes.Both, 439 - Size = new Vector2(0.125f, 1), 440 - }, 441 - new Container 442 - { 443 - RelativeSizeAxes = Axes.Both, 444 - Size = new Vector2(0.25f, 1), 445 - Children = new[] 447 + new InfofulBoxAutoSize 446 448 { 447 - new InfofulBoxAutoSize 449 + Anchor = Anchor.Centre, 450 + Origin = Anchor.Centre, 451 + Children = new[] 448 452 { 449 - Anchor = Anchor.Centre, 450 - Origin = Anchor.Centre, 451 - Children = new[] 453 + new Container 452 454 { 453 - new Container 455 + AutoSizeAxes = Axes.Both, 456 + Depth = -1, 457 + Padding = new MarginPadding(50), 458 + Children = new Drawable[] 454 459 { 455 - AutoSizeAxes = Axes.Both, 456 - Depth = -1, 457 - Padding = new MarginPadding(50), 458 - Children = new Drawable[] 460 + box1 = new InfofulBox 459 461 { 460 - box1 = new InfofulBox 461 - { 462 - Anchor = Anchor.TopLeft, 463 - Origin = Anchor.TopLeft, 464 - Size = new Vector2(50), 465 - Colour = Color4.Blue, 466 - }, 467 - } 462 + Anchor = Anchor.TopLeft, 463 + Origin = Anchor.TopLeft, 464 + Size = new Vector2(50), 465 + Colour = Color4.Blue, 466 + }, 468 467 } 469 468 } 470 - }, 471 - } 472 - }, 473 - new Container 469 + } 470 + }, 471 + } 472 + }, 473 + new Container 474 + { 475 + RelativeSizeAxes = Axes.Both, 476 + Size = new Vector2(0.25f, 1), 477 + Children = new[] 474 478 { 475 - RelativeSizeAxes = Axes.Both, 476 - Size = new Vector2(0.25f, 1), 477 - Children = new[] 479 + new InfofulBoxAutoSize 478 480 { 479 - new InfofulBoxAutoSize 481 + Anchor = Anchor.Centre, 482 + Origin = Anchor.Centre, 483 + Children = new[] 480 484 { 481 - Anchor = Anchor.Centre, 482 - Origin = Anchor.Centre, 483 - Children = new[] 485 + new Container 484 486 { 485 - new Container 487 + AutoSizeAxes = Axes.Both, 488 + Depth = -1, 489 + Padding = new MarginPadding(50), 490 + Children = new Drawable[] 486 491 { 487 - AutoSizeAxes = Axes.Both, 488 - Depth = -1, 489 - Padding = new MarginPadding(50), 490 - Children = new Drawable[] 492 + box2 = new InfofulBox 491 493 { 492 - box2 = new InfofulBox 493 - { 494 - Anchor = Anchor.Centre, 495 - Origin = Anchor.Centre, 496 - Size = new Vector2(50), 497 - Colour = Color4.Blue, 498 - }, 499 - } 494 + Anchor = Anchor.Centre, 495 + Origin = Anchor.Centre, 496 + Size = new Vector2(50), 497 + Colour = Color4.Blue, 498 + }, 500 499 } 501 500 } 502 - }, 503 - } 504 - }, 505 - new Container 501 + } 502 + }, 503 + } 504 + }, 505 + new Container 506 + { 507 + RelativeSizeAxes = Axes.Both, 508 + Size = new Vector2(0.25f, 1), 509 + Children = new[] 506 510 { 507 - RelativeSizeAxes = Axes.Both, 508 - Size = new Vector2(0.25f, 1), 509 - Children = new[] 511 + new InfofulBoxAutoSize 510 512 { 511 - new InfofulBoxAutoSize 513 + Anchor = Anchor.Centre, 514 + Origin = Anchor.Centre, 515 + Children = new[] 512 516 { 513 - Anchor = Anchor.Centre, 514 - Origin = Anchor.Centre, 515 - Children = new[] 517 + new Container 516 518 { 517 - new Container 519 + AutoSizeAxes = Axes.Both, 520 + Depth = -1, 521 + Padding = new MarginPadding(50), 522 + Children = new Drawable[] 518 523 { 519 - AutoSizeAxes = Axes.Both, 520 - Depth = -1, 521 - Padding = new MarginPadding(50), 522 - Children = new Drawable[] 524 + box3 = new InfofulBox 523 525 { 524 - box3 = new InfofulBox 525 - { 526 - Anchor = Anchor.BottomRight, 527 - Origin = Anchor.BottomRight, 528 - Size = new Vector2(50), 529 - Colour = Color4.Blue, 530 - }, 531 - } 526 + Anchor = Anchor.BottomRight, 527 + Origin = Anchor.BottomRight, 528 + Size = new Vector2(50), 529 + Colour = Color4.Blue, 530 + }, 532 531 } 533 532 } 534 - }, 535 - } 536 - }, 537 - } 538 - }); 533 + } 534 + }, 535 + } 536 + }, 537 + } 538 + }); 539 539 540 - foreach (Container b in new[] { box1, box2, box3 }) 541 - b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 540 + foreach (Container b in new[] { box1, box2, box3 }) 541 + b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 542 542 543 - break; 544 - } 543 + break; 544 + } 545 545 546 546 case 9: 547 - { 548 - Container box1; 549 - Container box2; 550 - Container box3; 547 + { 548 + Container box1; 549 + Container box2; 550 + Container box3; 551 551 552 - testContainer.Add(new FillFlowContainer 552 + testContainer.Add(new FillFlowContainer 553 + { 554 + RelativeSizeAxes = Axes.Both, 555 + Children = new Drawable[] 553 556 { 554 - RelativeSizeAxes = Axes.Both, 555 - Children = new Drawable[] 557 + // This first guy is used for spacing. 558 + new Container 556 559 { 557 - // This first guy is used for spacing. 558 - new Container 559 - { 560 - RelativeSizeAxes = Axes.Both, 561 - Size = new Vector2(0.125f, 1), 562 - }, 563 - new Container 560 + RelativeSizeAxes = Axes.Both, 561 + Size = new Vector2(0.125f, 1), 562 + }, 563 + new Container 564 + { 565 + RelativeSizeAxes = Axes.Both, 566 + Size = new Vector2(0.25f, 1), 567 + Children = new[] 564 568 { 565 - RelativeSizeAxes = Axes.Both, 566 - Size = new Vector2(0.25f, 1), 567 - Children = new[] 569 + new InfofulBoxAutoSize 568 570 { 569 - new InfofulBoxAutoSize 571 + Anchor = Anchor.Centre, 572 + Origin = Anchor.Centre, 573 + Children = new[] 570 574 { 571 - Anchor = Anchor.Centre, 572 - Origin = Anchor.Centre, 573 - Children = new[] 575 + new Container 574 576 { 575 - new Container 577 + AutoSizeAxes = Axes.Both, 578 + Depth = -1, 579 + Margin = new MarginPadding(50), 580 + Children = new Drawable[] 576 581 { 577 - AutoSizeAxes = Axes.Both, 578 - Depth = -1, 579 - Margin = new MarginPadding(50), 580 - Children = new Drawable[] 582 + box1 = new InfofulBox 581 583 { 582 - box1 = new InfofulBox 583 - { 584 - Anchor = Anchor.TopLeft, 585 - Origin = Anchor.TopLeft, 586 - Size = new Vector2(50), 587 - Colour = Color4.Blue, 588 - }, 589 - } 584 + Anchor = Anchor.TopLeft, 585 + Origin = Anchor.TopLeft, 586 + Size = new Vector2(50), 587 + Colour = Color4.Blue, 588 + }, 590 589 } 591 590 } 592 - }, 593 - } 594 - }, 595 - new Container 591 + } 592 + }, 593 + } 594 + }, 595 + new Container 596 + { 597 + RelativeSizeAxes = Axes.Both, 598 + Size = new Vector2(0.25f, 1), 599 + Children = new[] 596 600 { 597 - RelativeSizeAxes = Axes.Both, 598 - Size = new Vector2(0.25f, 1), 599 - Children = new[] 601 + new InfofulBoxAutoSize 600 602 { 601 - new InfofulBoxAutoSize 603 + Anchor = Anchor.Centre, 604 + Origin = Anchor.Centre, 605 + Children = new[] 602 606 { 603 - Anchor = Anchor.Centre, 604 - Origin = Anchor.Centre, 605 - Children = new[] 607 + new Container 606 608 { 607 - new Container 609 + AutoSizeAxes = Axes.Both, 610 + Depth = -1, 611 + Margin = new MarginPadding(50), 612 + Children = new Drawable[] 608 613 { 609 - AutoSizeAxes = Axes.Both, 610 - Depth = -1, 611 - Margin = new MarginPadding(50), 612 - Children = new Drawable[] 614 + box2 = new InfofulBox 613 615 { 614 - box2 = new InfofulBox 615 - { 616 - Anchor = Anchor.Centre, 617 - Origin = Anchor.Centre, 618 - Size = new Vector2(50), 619 - Colour = Color4.Blue, 620 - }, 621 - } 616 + Anchor = Anchor.Centre, 617 + Origin = Anchor.Centre, 618 + Size = new Vector2(50), 619 + Colour = Color4.Blue, 620 + }, 622 621 } 623 622 } 624 - }, 625 - } 626 - }, 627 - new Container 623 + } 624 + }, 625 + } 626 + }, 627 + new Container 628 + { 629 + RelativeSizeAxes = Axes.Both, 630 + Size = new Vector2(0.25f, 1), 631 + Children = new[] 628 632 { 629 - RelativeSizeAxes = Axes.Both, 630 - Size = new Vector2(0.25f, 1), 631 - Children = new[] 633 + new InfofulBoxAutoSize 632 634 { 633 - new InfofulBoxAutoSize 635 + Anchor = Anchor.Centre, 636 + Origin = Anchor.Centre, 637 + Children = new[] 634 638 { 635 - Anchor = Anchor.Centre, 636 - Origin = Anchor.Centre, 637 - Children = new[] 639 + new Container 638 640 { 639 - new Container 641 + AutoSizeAxes = Axes.Both, 642 + Depth = -1, 643 + Margin = new MarginPadding(50), 644 + Children = new Drawable[] 640 645 { 641 - AutoSizeAxes = Axes.Both, 642 - Depth = -1, 643 - Margin = new MarginPadding(50), 644 - Children = new Drawable[] 646 + box3 = new InfofulBox 645 647 { 646 - box3 = new InfofulBox 647 - { 648 - Anchor = Anchor.BottomRight, 649 - Origin = Anchor.BottomRight, 650 - Size = new Vector2(50), 651 - Colour = Color4.Blue, 652 - }, 653 - } 648 + Anchor = Anchor.BottomRight, 649 + Origin = Anchor.BottomRight, 650 + Size = new Vector2(50), 651 + Colour = Color4.Blue, 652 + }, 654 653 } 655 654 } 656 - }, 657 - } 658 - }, 659 - } 660 - }); 655 + } 656 + }, 657 + } 658 + }, 659 + } 660 + }); 661 661 662 - foreach (Container b in new[] { box1, box2, box3 }) 663 - b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 662 + foreach (Container b in new[] { box1, box2, box3 }) 663 + b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 664 664 665 - break; 666 - } 665 + break; 666 + } 667 667 668 668 case 10: 669 - { 670 - Container box1; 671 - Container box2; 672 - Container box3; 669 + { 670 + Container box1; 671 + Container box2; 672 + Container box3; 673 673 674 - testContainer.Add(new FillFlowContainer 674 + testContainer.Add(new FillFlowContainer 675 + { 676 + RelativeSizeAxes = Axes.Both, 677 + Children = new Drawable[] 675 678 { 676 - RelativeSizeAxes = Axes.Both, 677 - Children = new Drawable[] 679 + // This first guy is used for spacing. 680 + new Container 678 681 { 679 - // This first guy is used for spacing. 680 - new Container 681 - { 682 - RelativeSizeAxes = Axes.Both, 683 - Size = new Vector2(0.125f, 1), 684 - }, 685 - new Container 682 + RelativeSizeAxes = Axes.Both, 683 + Size = new Vector2(0.125f, 1), 684 + }, 685 + new Container 686 + { 687 + RelativeSizeAxes = Axes.Both, 688 + Size = new Vector2(0.25f, 1), 689 + Children = new[] 686 690 { 687 - RelativeSizeAxes = Axes.Both, 688 - Size = new Vector2(0.25f, 1), 689 - Children = new[] 691 + new InfofulBoxAutoSize 690 692 { 691 - new InfofulBoxAutoSize 693 + Anchor = Anchor.Centre, 694 + Origin = Anchor.Centre, 695 + Children = new[] 692 696 { 693 - Anchor = Anchor.Centre, 694 - Origin = Anchor.Centre, 695 - Children = new[] 697 + new Container 696 698 { 697 - new Container 699 + AutoSizeAxes = Axes.Both, 700 + Depth = -1, 701 + Children = new Drawable[] 698 702 { 699 - AutoSizeAxes = Axes.Both, 700 - Depth = -1, 701 - Children = new Drawable[] 703 + box1 = new InfofulBox 702 704 { 703 - box1 = new InfofulBox 704 - { 705 - Margin = new MarginPadding(50), 706 - Anchor = Anchor.TopLeft, 707 - Origin = Anchor.TopLeft, 708 - Size = new Vector2(50), 709 - Colour = Color4.Blue, 710 - }, 711 - } 705 + Margin = new MarginPadding(50), 706 + Anchor = Anchor.TopLeft, 707 + Origin = Anchor.TopLeft, 708 + Size = new Vector2(50), 709 + Colour = Color4.Blue, 710 + }, 712 711 } 713 712 } 714 - }, 715 - } 716 - }, 717 - new Container 713 + } 714 + }, 715 + } 716 + }, 717 + new Container 718 + { 719 + RelativeSizeAxes = Axes.Both, 720 + Size = new Vector2(0.25f, 1), 721 + Children = new[] 718 722 { 719 - RelativeSizeAxes = Axes.Both, 720 - Size = new Vector2(0.25f, 1), 721 - Children = new[] 723 + new InfofulBoxAutoSize 722 724 { 723 - new InfofulBoxAutoSize 725 + Anchor = Anchor.Centre, 726 + Origin = Anchor.Centre, 727 + Children = new[] 724 728 { 725 - Anchor = Anchor.Centre, 726 - Origin = Anchor.Centre, 727 - Children = new[] 729 + new Container 728 730 { 729 - new Container 731 + AutoSizeAxes = Axes.Both, 732 + Depth = -1, 733 + Children = new Drawable[] 730 734 { 731 - AutoSizeAxes = Axes.Both, 732 - Depth = -1, 733 - Children = new Drawable[] 735 + box2 = new InfofulBox 734 736 { 735 - box2 = new InfofulBox 736 - { 737 - Margin = new MarginPadding(50), 738 - Anchor = Anchor.Centre, 739 - Origin = Anchor.Centre, 740 - Size = new Vector2(50), 741 - Colour = Color4.Blue, 742 - }, 743 - } 737 + Margin = new MarginPadding(50), 738 + Anchor = Anchor.Centre, 739 + Origin = Anchor.Centre, 740 + Size = new Vector2(50), 741 + Colour = Color4.Blue, 742 + }, 744 743 } 745 744 } 746 - }, 747 - } 748 - }, 749 - new Container 745 + } 746 + }, 747 + } 748 + }, 749 + new Container 750 + { 751 + RelativeSizeAxes = Axes.Both, 752 + Size = new Vector2(0.25f, 1), 753 + Children = new[] 750 754 { 751 - RelativeSizeAxes = Axes.Both, 752 - Size = new Vector2(0.25f, 1), 753 - Children = new[] 755 + new InfofulBoxAutoSize 754 756 { 755 - new InfofulBoxAutoSize 757 + Anchor = Anchor.Centre, 758 + Origin = Anchor.Centre, 759 + Children = new[] 756 760 { 757 - Anchor = Anchor.Centre, 758 - Origin = Anchor.Centre, 759 - Children = new[] 761 + new Container 760 762 { 761 - new Container 763 + AutoSizeAxes = Axes.Both, 764 + Depth = -1, 765 + Children = new Drawable[] 762 766 { 763 - AutoSizeAxes = Axes.Both, 764 - Depth = -1, 765 - Children = new Drawable[] 767 + box3 = new InfofulBox 766 768 { 767 - box3 = new InfofulBox 768 - { 769 - Margin = new MarginPadding(50), 770 - Anchor = Anchor.BottomRight, 771 - Origin = Anchor.BottomRight, 772 - Size = new Vector2(50), 773 - Colour = Color4.Blue, 774 - }, 775 - } 769 + Margin = new MarginPadding(50), 770 + Anchor = Anchor.BottomRight, 771 + Origin = Anchor.BottomRight, 772 + Size = new Vector2(50), 773 + Colour = Color4.Blue, 774 + }, 776 775 } 777 776 } 778 - }, 779 - } 780 - }, 781 - } 782 - }); 777 + } 778 + }, 779 + } 780 + }, 781 + } 782 + }); 783 783 784 - foreach (Container b in new[] { box1, box2, box3 }) 785 - b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 784 + foreach (Container b in new[] { box1, box2, box3 }) 785 + b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 786 786 787 - break; 788 - } 787 + break; 788 + } 789 789 790 790 case 11: 791 - { 792 - Drawable box1; 793 - Drawable box2; 794 - Drawable box3; 791 + { 792 + Drawable box1; 793 + Drawable box2; 794 + Drawable box3; 795 795 796 - testContainer.Add(new FillFlowContainer 796 + testContainer.Add(new FillFlowContainer 797 + { 798 + RelativeSizeAxes = Axes.Both, 799 + Children = new Drawable[] 797 800 { 798 - RelativeSizeAxes = Axes.Both, 799 - Children = new Drawable[] 801 + // This first guy is used for spacing. 802 + new Container 800 803 { 801 - // This first guy is used for spacing. 802 - new Container 803 - { 804 - RelativeSizeAxes = Axes.Both, 805 - Size = new Vector2(0.125f, 1), 806 - }, 807 - new Container 804 + RelativeSizeAxes = Axes.Both, 805 + Size = new Vector2(0.125f, 1), 806 + }, 807 + new Container 808 + { 809 + RelativeSizeAxes = Axes.Both, 810 + Size = new Vector2(0.25f, 1), 811 + Children = new[] 808 812 { 809 - RelativeSizeAxes = Axes.Both, 810 - Size = new Vector2(0.25f, 1), 811 - Children = new[] 813 + new InfofulBoxAutoSize 812 814 { 813 - new InfofulBoxAutoSize 815 + Anchor = Anchor.Centre, 816 + Origin = Anchor.Centre, 817 + Children = new[] 814 818 { 815 - Anchor = Anchor.Centre, 816 - Origin = Anchor.Centre, 817 - Children = new[] 819 + new Container 818 820 { 819 - new Container 821 + AutoSizeAxes = Axes.Both, 822 + Depth = -1, 823 + Children = new[] 820 824 { 821 - AutoSizeAxes = Axes.Both, 822 - Depth = -1, 823 - Children = new[] 825 + box1 = new Box 824 826 { 825 - box1 = new Box 826 - { 827 - Margin = new MarginPadding(50), 828 - Anchor = Anchor.TopLeft, 829 - Origin = Anchor.TopLeft, 830 - Size = new Vector2(50), 831 - Colour = Color4.Blue, 832 - }, 833 - } 827 + Margin = new MarginPadding(50), 828 + Anchor = Anchor.TopLeft, 829 + Origin = Anchor.TopLeft, 830 + Size = new Vector2(50), 831 + Colour = Color4.Blue, 832 + }, 834 833 } 835 834 } 836 - }, 837 - } 838 - }, 839 - new Container 835 + } 836 + }, 837 + } 838 + }, 839 + new Container 840 + { 841 + RelativeSizeAxes = Axes.Both, 842 + Size = new Vector2(0.25f, 1), 843 + Children = new[] 840 844 { 841 - RelativeSizeAxes = Axes.Both, 842 - Size = new Vector2(0.25f, 1), 843 - Children = new[] 845 + new InfofulBoxAutoSize 844 846 { 845 - new InfofulBoxAutoSize 847 + Anchor = Anchor.Centre, 848 + Origin = Anchor.Centre, 849 + Children = new[] 846 850 { 847 - Anchor = Anchor.Centre, 848 - Origin = Anchor.Centre, 849 - Children = new[] 851 + new Container 850 852 { 851 - new Container 853 + AutoSizeAxes = Axes.Both, 854 + Depth = -1, 855 + Children = new[] 852 856 { 853 - AutoSizeAxes = Axes.Both, 854 - Depth = -1, 855 - Children = new[] 857 + box2 = new Box 856 858 { 857 - box2 = new Box 858 - { 859 - Margin = new MarginPadding(50), 860 - Anchor = Anchor.Centre, 861 - Origin = Anchor.Centre, 862 - Size = new Vector2(50), 863 - Colour = Color4.Blue, 864 - }, 865 - } 859 + Margin = new MarginPadding(50), 860 + Anchor = Anchor.Centre, 861 + Origin = Anchor.Centre, 862 + Size = new Vector2(50), 863 + Colour = Color4.Blue, 864 + }, 866 865 } 867 866 } 868 - }, 869 - } 870 - }, 871 - new Container 867 + } 868 + }, 869 + } 870 + }, 871 + new Container 872 + { 873 + RelativeSizeAxes = Axes.Both, 874 + Size = new Vector2(0.25f, 1), 875 + Children = new[] 872 876 { 873 - RelativeSizeAxes = Axes.Both, 874 - Size = new Vector2(0.25f, 1), 875 - Children = new[] 877 + new InfofulBoxAutoSize 876 878 { 877 - new InfofulBoxAutoSize 879 + Anchor = Anchor.Centre, 880 + Origin = Anchor.Centre, 881 + Children = new[] 878 882 { 879 - Anchor = Anchor.Centre, 880 - Origin = Anchor.Centre, 881 - Children = new[] 883 + new Container 882 884 { 883 - new Container 885 + AutoSizeAxes = Axes.Both, 886 + Depth = -1, 887 + Children = new[] 884 888 { 885 - AutoSizeAxes = Axes.Both, 886 - Depth = -1, 887 - Children = new[] 889 + box3 = new Box 888 890 { 889 - box3 = new Box 890 - { 891 - Margin = new MarginPadding(50), 892 - Anchor = Anchor.BottomRight, 893 - Origin = Anchor.BottomRight, 894 - Size = new Vector2(50), 895 - Colour = Color4.Blue, 896 - }, 897 - } 891 + Margin = new MarginPadding(50), 892 + Anchor = Anchor.BottomRight, 893 + Origin = Anchor.BottomRight, 894 + Size = new Vector2(50), 895 + Colour = Color4.Blue, 896 + }, 898 897 } 899 898 } 900 - }, 901 - } 902 - }, 903 - } 904 - }); 899 + } 900 + }, 901 + } 902 + }, 903 + } 904 + }); 905 + 906 + foreach (Drawable b in new[] { box1, box2, box3 }) 907 + b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 905 908 906 - foreach (Drawable b in new[] { box1, box2, box3 }) 907 - b.ScaleTo(new Vector2(2), 1000).Then().ScaleTo(Vector2.One, 1000).Loop(); 909 + break; 910 + } 908 911 909 - break; 910 - } 911 912 case 12: 913 + { 914 + // demonstrates how relativeaxes drawables act inside an autosize parent 915 + Drawable sizedBox; 916 + 917 + testContainer.Add(new FillFlowContainer 912 918 { 913 - // demonstrates how relativeaxes drawables act inside an autosize parent 914 - Drawable sizedBox; 915 - 916 - testContainer.Add(new FillFlowContainer 919 + RelativeSizeAxes = Axes.Both, 920 + Children = new Drawable[] 917 921 { 918 - RelativeSizeAxes = Axes.Both, 919 - Children = new Drawable[] 920 - { 921 922 new Container 922 923 { 923 924 Size = new Vector2(300), ··· 952 953 } 953 954 } 954 955 } 955 - } 956 - }); 956 + } 957 + }); 957 958 958 - sizedBox.ScaleTo(new Vector2(2), 1000, Easing.Out).Then().ScaleTo(Vector2.One, 1000, Easing.In).Loop(); 959 - break; 960 - } 959 + sizedBox.ScaleTo(new Vector2(2), 1000, Easing.Out).Then().ScaleTo(Vector2.One, 1000, Easing.In).Loop(); 960 + break; 961 + } 962 + 961 963 case 13: 964 + { 965 + testContainer.Add(new FillFlowContainer 962 966 { 963 - testContainer.Add(new FillFlowContainer 967 + Anchor = Anchor.Centre, 968 + Origin = Anchor.Centre, 969 + RelativeSizeAxes = Axes.X, 970 + AutoSizeAxes = Axes.Y, 971 + Direction = FillDirection.Vertical, 972 + Spacing = new Vector2(0, 20), 973 + Children = new[] 964 974 { 965 - Anchor = Anchor.Centre, 966 - Origin = Anchor.Centre, 967 - RelativeSizeAxes = Axes.X, 968 - AutoSizeAxes = Axes.Y, 969 - Direction = FillDirection.Vertical, 970 - Spacing = new Vector2(0, 20), 971 - Children = new[] 975 + new FillFlowContainer 972 976 { 973 - new FillFlowContainer 977 + Name = "Top row", 978 + RelativeSizeAxes = Axes.X, 979 + Height = 200, 980 + Direction = FillDirection.Horizontal, 981 + Spacing = new Vector2(100, 0), 982 + Children = new[] 974 983 { 975 - Name = "Top row", 976 - RelativeSizeAxes = Axes.X, 977 - Height = 200, 978 - Direction = FillDirection.Horizontal, 979 - Spacing = new Vector2(100, 0), 980 - Children = new[] 981 - { 982 - new NegativeSizingContainer(Anchor.TopLeft, true), 983 - new NegativeSizingContainer(Anchor.Centre, true), 984 - new NegativeSizingContainer(Anchor.BottomRight, true) 985 - } 986 - }, 987 - new FillFlowContainer 984 + new NegativeSizingContainer(Anchor.TopLeft, true), 985 + new NegativeSizingContainer(Anchor.Centre, true), 986 + new NegativeSizingContainer(Anchor.BottomRight, true) 987 + } 988 + }, 989 + new FillFlowContainer 990 + { 991 + Name = "Bottom row", 992 + RelativeSizeAxes = Axes.X, 993 + Height = 200, 994 + Direction = FillDirection.Horizontal, 995 + Spacing = new Vector2(100, 0), 996 + Children = new[] 988 997 { 989 - Name = "Bottom row", 990 - RelativeSizeAxes = Axes.X, 991 - Height = 200, 992 - Direction = FillDirection.Horizontal, 993 - Spacing = new Vector2(100, 0), 994 - Children = new[] 995 - { 996 - new NegativeSizingContainer(Anchor.TopLeft, false), 997 - new NegativeSizingContainer(Anchor.Centre, false), 998 - new NegativeSizingContainer(Anchor.BottomRight, false) 999 - } 998 + new NegativeSizingContainer(Anchor.TopLeft, false), 999 + new NegativeSizingContainer(Anchor.Centre, false), 1000 + new NegativeSizingContainer(Anchor.BottomRight, false) 1000 1001 } 1001 1002 } 1002 - }); 1003 + } 1004 + }); 1003 1005 1004 - break; 1005 - } 1006 + break; 1007 + } 1006 1008 } 1007 1009 } 1008 1010 ··· 1143 1145 return true; 1144 1146 } 1145 1147 1146 - protected override bool OnDragEnd(DragEndEvent e) 1147 - { 1148 - return true; 1149 - } 1148 + protected override bool OnDragEnd(DragEndEvent e) => true; 1150 1149 1151 1150 protected override bool OnDragStart(DragStartEvent e) => AllowDrag; 1152 1151 } ··· 1164 1163 return true; 1165 1164 } 1166 1165 1167 - protected override bool OnDragEnd(DragEndEvent e) 1168 - { 1169 - return true; 1170 - } 1166 + protected override bool OnDragEnd(DragEndEvent e) => true; 1171 1167 1172 1168 protected override bool OnDragStart(DragStartEvent e) => AllowDrag; 1173 1169
+19 -21
osu.Framework.Tests/Visual/Drawables/TestCasePropertyBoundaries.cs
··· 65 65 AddAssert("Box has valid draw matrix", () => checkDrawInfo(box.DrawInfo)); 66 66 } 67 67 68 - private bool checkDrawInfo(DrawInfo drawInfo) 69 - { 70 - return checkFloat(drawInfo.Matrix.M11) 71 - && checkFloat(drawInfo.Matrix.M12) 72 - && checkFloat(drawInfo.Matrix.M13) 73 - && checkFloat(drawInfo.Matrix.M21) 74 - && checkFloat(drawInfo.Matrix.M22) 75 - && checkFloat(drawInfo.Matrix.M23) 76 - && checkFloat(drawInfo.Matrix.M31) 77 - && checkFloat(drawInfo.Matrix.M32) 78 - && checkFloat(drawInfo.Matrix.M33) 79 - && checkFloat(drawInfo.MatrixInverse.M11) 80 - && checkFloat(drawInfo.MatrixInverse.M12) 81 - && checkFloat(drawInfo.MatrixInverse.M13) 82 - && checkFloat(drawInfo.MatrixInverse.M21) 83 - && checkFloat(drawInfo.MatrixInverse.M22) 84 - && checkFloat(drawInfo.MatrixInverse.M23) 85 - && checkFloat(drawInfo.MatrixInverse.M31) 86 - && checkFloat(drawInfo.MatrixInverse.M32) 87 - && checkFloat(drawInfo.MatrixInverse.M33); 88 - } 68 + private bool checkDrawInfo(DrawInfo drawInfo) => 69 + checkFloat(drawInfo.Matrix.M11) 70 + && checkFloat(drawInfo.Matrix.M12) 71 + && checkFloat(drawInfo.Matrix.M13) 72 + && checkFloat(drawInfo.Matrix.M21) 73 + && checkFloat(drawInfo.Matrix.M22) 74 + && checkFloat(drawInfo.Matrix.M23) 75 + && checkFloat(drawInfo.Matrix.M31) 76 + && checkFloat(drawInfo.Matrix.M32) 77 + && checkFloat(drawInfo.Matrix.M33) 78 + && checkFloat(drawInfo.MatrixInverse.M11) 79 + && checkFloat(drawInfo.MatrixInverse.M12) 80 + && checkFloat(drawInfo.MatrixInverse.M13) 81 + && checkFloat(drawInfo.MatrixInverse.M21) 82 + && checkFloat(drawInfo.MatrixInverse.M22) 83 + && checkFloat(drawInfo.MatrixInverse.M23) 84 + && checkFloat(drawInfo.MatrixInverse.M31) 85 + && checkFloat(drawInfo.MatrixInverse.M32) 86 + && checkFloat(drawInfo.MatrixInverse.M33); 89 87 90 88 private bool checkFloat(float value) => !float.IsNaN(value) && !float.IsInfinity(value) && !float.IsNegativeInfinity(value); 91 89 }
+1
osu.Framework.Tests/Visual/Drawables/TestCaseUpdateBeforeDraw.cs
··· 70 70 71 71 if (hasInvoked) 72 72 return; 73 + 73 74 hasInvoked = true; 74 75 75 76 OnUpdateAfterChildren?.Invoke();
+2
osu.Framework.Tests/Visual/Input/TestCaseJoystick.cs
··· 252 252 background.FadeColour(Color4.DarkRed, 100, Easing.OutQuint); 253 253 else 254 254 return base.OnJoystickPress(e); 255 + 255 256 return true; 256 257 } 257 258 ··· 261 262 background.FadeColour(new Color4(0, 0, 0, 0), 100, Easing.OutQuint); 262 263 else 263 264 return base.OnJoystickRelease(e); 265 + 264 266 return true; 265 267 } 266 268 }
+3 -6
osu.Framework.Tests/Visual/Input/TestCaseMouseStates.cs
··· 371 371 } 372 372 373 373 private readonly Dictionary<Type, int> eventCounts1 = new Dictionary<Type, int>(), 374 - eventCounts2 = new Dictionary<Type, int>(); 374 + eventCounts2 = new Dictionary<Type, int>(); 375 375 376 376 private void checkEventCount(Type type, int change = 0, bool outer = false) 377 377 { ··· 524 524 525 525 public int Count 526 526 { 527 - get { return count; } 527 + get => count; 528 528 set 529 529 { 530 530 count = value; ··· 614 614 TextContainer.Add(dragStatus = new SmallText()); 615 615 } 616 616 617 - protected override bool Handle(UIEvent e) 618 - { 619 - return base.Handle(e) || e is DragStartEvent; 620 - } 617 + protected override bool Handle(UIEvent e) => base.Handle(e) || e is DragStartEvent; 621 618 622 619 protected override void Update() 623 620 {
+29 -11
osu.Framework.Tests/Visual/Layout/TestCaseFillFlowContainer.cs
··· 263 263 { 264 264 switch (RNG.Next(9)) 265 265 { 266 - case 0: child.Origin = Anchor.TopLeft; break; 267 - case 1: child.Origin = Anchor.TopCentre; break; 268 - case 2: child.Origin = Anchor.TopRight; break; 269 - case 3: child.Origin = Anchor.CentreLeft; break; 270 - case 4: child.Origin = Anchor.Centre; break; 271 - case 5: child.Origin = Anchor.CentreRight; break; 272 - case 6: child.Origin = Anchor.BottomLeft; break; 273 - case 7: child.Origin = Anchor.BottomCentre; break; 274 - case 8: child.Origin = Anchor.BottomRight; break; 266 + case 0: 267 + child.Origin = Anchor.TopLeft; 268 + break; 269 + case 1: 270 + child.Origin = Anchor.TopCentre; 271 + break; 272 + case 2: 273 + child.Origin = Anchor.TopRight; 274 + break; 275 + case 3: 276 + child.Origin = Anchor.CentreLeft; 277 + break; 278 + case 4: 279 + child.Origin = Anchor.Centre; 280 + break; 281 + case 5: 282 + child.Origin = Anchor.CentreRight; 283 + break; 284 + case 6: 285 + child.Origin = Anchor.BottomLeft; 286 + break; 287 + case 7: 288 + child.Origin = Anchor.BottomCentre; 289 + break; 290 + case 8: 291 + child.Origin = Anchor.BottomRight; 292 + break; 275 293 } 276 294 } 277 295 } ··· 355 373 356 374 protected internal override string Label 357 375 { 358 - get { return label.Text; } 359 - set { label.Text = value; } 376 + get => label.Text; 377 + set => label.Text = value; 360 378 } 361 379 362 380 public TestCaseDropdownHeader()
+13 -12
osu.Framework.Tests/Visual/Platform/TestCaseBorderless.cs
··· 65 65 BorderThickness = 20, 66 66 Masking = true, 67 67 68 - Children = new Drawable[] { 68 + Children = new Drawable[] 69 + { 69 70 new Box 70 71 { 71 72 RelativeSizeAxes = Axes.Both, ··· 104 105 windowMode.TriggerChange(); 105 106 } 106 107 107 - private Container createScreen(DisplayDevice device, string name) 108 - { 109 - return new Container 108 + private Container createScreen(DisplayDevice device, string name) => 109 + new Container 110 110 { 111 111 X = device.Bounds.X, 112 112 Y = device.Bounds.Y, ··· 133 133 } 134 134 } 135 135 }; 136 - } 137 136 138 137 [BackgroundDependencyLoader] 139 138 private void load(FrameworkConfigManager config, GameHost host) ··· 153 152 const string desc1 = "Check whether the borderless window is properly set to the top left corner, even if it is obstructed by the taskbar"; 154 153 const string desc2 = "Check whether the window size is one pixel wider than the screen in each direction"; 155 154 156 - for(int i = 0;; i++) 155 + for (int i = 0;; i++) 157 156 { 158 157 var display = DisplayDevice.GetDisplay((DisplayIndex)i); 159 - if(display == null) break; 158 + if (display == null) break; 160 159 161 160 // set up window 162 161 AddStep("switch to windowed", () => windowMode.Value = WindowMode.Windowed); ··· 183 182 screenContainer.Clear(); 184 183 var bounds = new RectangleI(); 185 184 186 - for(int i = 0;; i++) 185 + for (int i = 0;; i++) 187 186 { 188 187 var device = DisplayDevice.GetDisplay((DisplayIndex)i); 189 - if(device == null) break; 188 + if (device == null) break; 190 189 191 190 screenContainer.Add(createScreen(device, device.IsPrimary ? $"Screen {i} (Primary)" : $"Screen {i}")); 192 191 bounds = RectangleI.Union(bounds, new RectangleI(device.Bounds.X, device.Bounds.Y, device.Width, device.Height)); ··· 195 194 screenContainer.Add(windowContainer); 196 195 screenContainerOffset = bounds.Location; 197 196 198 - foreach(var box in screenContainer.Children) 197 + foreach (var box in screenContainer.Children) 199 198 { 200 199 box.Position -= bounds.Location; 201 200 } 201 + 202 202 screenContainer.Size = bounds.Size; 203 203 } 204 204 205 205 private void updateWindowContainer() 206 206 { 207 - if(window == null) return; 207 + if (window == null) return; 208 + 208 209 bool fullscreen = window.WindowMode.Value == WindowMode.Fullscreen; 209 210 210 211 windowContainer.X = window.X; ··· 219 220 { 220 221 base.Update(); 221 222 222 - if(window == null) 223 + if (window == null) 223 224 { 224 225 currentDisplay.Text = "No suitable window found"; 225 226 return;
+1 -4
osu.Framework.Tests/Visual/Sprites/TestCaseTriangles.cs
··· 180 180 return true; 181 181 } 182 182 183 - protected override bool OnDragEnd(DragEndEvent e) 184 - { 185 - return true; 186 - } 183 + protected override bool OnDragEnd(DragEndEvent e) => true; 187 184 188 185 protected override bool OnDragStart(DragStartEvent e) => AllowDrag; 189 186 }
+6 -8
osu.Framework.Tests/Visual/UserInterface/TestCaseContextMenu.cs
··· 19 19 20 20 private readonly ContextMenuBox movingBox; 21 21 22 - private ContextMenuBox makeBox(Anchor anchor) 23 - { 24 - return new ContextMenuBox 22 + private ContextMenuBox makeBox(Anchor anchor) => 23 + new ContextMenuBox 25 24 { 26 25 Size = new Vector2(200), 27 26 Anchor = anchor, ··· 35 34 } 36 35 } 37 36 }; 38 - } 39 37 40 38 public TestCaseContextMenu() 41 39 { ··· 59 57 60 58 // Move box along a square trajectory 61 59 movingBox.MoveTo(new Vector2(0, 100), duration) 62 - .Then().MoveTo(new Vector2(100, 100), duration) 63 - .Then().MoveTo(new Vector2(100, 0), duration) 64 - .Then().MoveTo(Vector2.Zero, duration) 65 - .Loop(); 60 + .Then().MoveTo(new Vector2(100, 100), duration) 61 + .Then().MoveTo(new Vector2(100, 0), duration) 62 + .Then().MoveTo(Vector2.Zero, duration) 63 + .Loop(); 66 64 } 67 65 68 66 private class ContextMenuBox : Container, IHasContextMenu
+2 -2
osu.Framework.Tests/Visual/UserInterface/TestCaseDropdownBox.cs
··· 139 139 140 140 protected internal override string Label 141 141 { 142 - get { return label.Text; } 143 - set { label.Text = value; } 142 + get => label.Text; 143 + set => label.Text = value; 144 144 } 145 145 146 146 public StyledDropdownHeader()
+8 -13
osu.Framework.Tests/Visual/UserInterface/TestCaseNestedMenus.cs
··· 62 62 { 63 63 protected override Menu CreateSubMenu() => new ClickOpenMenu(HoverOpenDelay, false); 64 64 65 - public ClickOpenMenu(double timePerAction, bool topLevel = true) : base(Direction.Vertical, topLevel) 65 + public ClickOpenMenu(double timePerAction, bool topLevel = true) 66 + : base(Direction.Vertical, topLevel) 66 67 { 67 68 HoverOpenDelay = timePerAction; 68 69 } ··· 164 165 public void TestHoverChange() 165 166 { 166 167 IReadOnlyList<MenuItem> currentItems = null; 167 - AddStep("Click item", () => 168 - { 169 - clickItem(0, 0); 170 - }); 168 + AddStep("Click item", () => { clickItem(0, 0); }); 171 169 172 - AddStep("Get items", () => 173 - { 174 - currentItems = menus.GetSubMenu(1).Items; 175 - }); 170 + AddStep("Get items", () => { currentItems = menus.GetSubMenu(1).Items; }); 176 171 177 172 AddAssert("Check open", () => menus.GetSubMenu(1).State == MenuState.Open); 178 173 AddStep("Hover item", () => InputManager.MoveMouseTo(menus.GetSubStructure(0).GetMenuItems()[1])); ··· 190 185 191 186 if (subMenu.State == MenuState.Open) 192 187 return false; 188 + 193 189 currentSubMenu++; 194 190 } 195 191 ··· 209 205 AddAssert("Check closed", () => menus.GetSubMenu(2)?.State != MenuState.Open); 210 206 AddAssert("Check closed", () => menus.GetSubMenu(2)?.State != MenuState.Open); 211 207 212 - AddStep("Hover item", () => 213 - { 214 - InputManager.MoveMouseTo(menus.GetSubStructure(1).GetMenuItems()[1]); 215 - }); 208 + AddStep("Hover item", () => { InputManager.MoveMouseTo(menus.GetSubStructure(1).GetMenuItems()[1]); }); 216 209 217 210 AddAssert("Check closed", () => menus.GetSubMenu(2)?.State != MenuState.Open); 218 211 AddAssert("Check open", () => menus.GetSubMenu(2).State == MenuState.Open); ··· 228 221 229 222 if (subMenu.State == MenuState.Open) 230 223 return false; 224 + 231 225 currentSubMenu++; 232 226 } 233 227 ··· 378 372 AddStep("Close menus", () => menus.GetSubMenu(0).Close()); 379 373 AddAssert("Check selected index 4", () => menus.GetSubStructure(1).GetSelectedIndex() == -1); 380 374 } 375 + 381 376 #endregion 382 377 383 378 /// <summary>
+5 -4
osu.Framework.Tests/Visual/UserInterface/TestCaseRigidBody.cs
··· 18 18 private readonly TestRigidBodySimulation sim; 19 19 20 20 private float restitutionBacking; 21 + 21 22 private float restitution 22 23 { 23 - get { return restitutionBacking; } 24 + get => restitutionBacking; 24 25 set 25 26 { 26 27 restitutionBacking = value; ··· 35 36 } 36 37 37 38 private float frictionBacking; 39 + 38 40 private float friction 39 41 { 40 - get { return frictionBacking; } 42 + get => frictionBacking; 41 43 set 42 44 { 43 45 frictionBacking = value; ··· 81 83 do 82 84 { 83 85 d = generate(); 84 - } 85 - while (overlapsAny(d)); 86 + } while (overlapsAny(d)); 86 87 87 88 sim.Add(d); 88 89 }
+1
osu.Framework.Tests/Visual/UserInterface/TestCaseScreenStack.cs
··· 448 448 { 449 449 if (screens.Last() != screen) 450 450 throw new InvalidOperationException("Disposal order was wrong"); 451 + 451 452 screens.Remove(screen); 452 453 }; 453 454
+2 -4
osu.Framework.Tests/Visual/UserInterface/TestCaseTooltip.cs
··· 28 28 generateTest(false); 29 29 } 30 30 31 - private TooltipBox makeBox(Anchor anchor) 32 - { 33 - return new TooltipBox 31 + private TooltipBox makeBox(Anchor anchor) => 32 + new TooltipBox 34 33 { 35 34 RelativeSizeAxes = Axes.Both, 36 35 Size = new Vector2(0.2f), ··· 39 38 Colour = Color4.Blue, 40 39 TooltipText = $"{anchor}", 41 40 }; 42 - } 43 41 44 42 private void generateTest(bool cursorlessTooltip) 45 43 {
+1
osu.Framework/Allocation/BackgroundDependencyLoaderAttribute.cs
··· 87 87 var val = dc.Get(type); 88 88 if (val == null && !permitNulls) 89 89 throw new DependencyNotRegisteredException(requestingType, type); 90 + 90 91 return val; 91 92 }; 92 93 }
+3
osu.Framework/Allocation/CachedAttribute.cs
··· 115 115 116 116 break; 117 117 } 118 + 118 119 case FieldInfo fi: 119 120 { 120 121 var modifier = fi.GetAccessModifier(); 121 122 if (modifier != AccessModifier.Private && !fi.IsInitOnly) 122 123 throw new AccessModifierNotAllowedForCachedValueException(modifier, fi); 124 + 123 125 break; 124 126 } 125 127 } ··· 140 142 { 141 143 if (allowValueTypes) 142 144 return; 145 + 143 146 throw new NullReferenceException($"Attempted to cache a null value: {type.ReadableName()}.{member.Name}."); 144 147 } 145 148
+1 -1
osu.Framework/Allocation/CachedModelDependencyContainer.cs
··· 34 34 private readonly IReadOnlyDependencyContainer parent; 35 35 private readonly IReadOnlyDependencyContainer shadowDependencies; 36 36 37 - 38 37 public CachedModelDependencyContainer(IReadOnlyDependencyContainer parent) 39 38 { 40 39 this.parent = parent; ··· 62 61 return type == typeof(TModel) ? createChildShadowModel() : parent?.Get(type, info); 63 62 if (info.Parent == typeof(TModel)) 64 63 return shadowDependencies.Get(type, info) ?? parent?.Get(type, info); 64 + 65 65 return parent?.Get(type, info); 66 66 } 67 67
+1
osu.Framework/Allocation/DependencyActivator.cs
··· 65 65 { 66 66 if (!activator_cache.TryGetValue(type, out var existing)) 67 67 return activator_cache[type] = new DependencyActivator(type); 68 + 68 69 return existing; 69 70 } 70 71
+2 -1
osu.Framework/Allocation/DependencyContainer.cs
··· 97 97 { 98 98 if (instance == null) 99 99 return; 100 + 100 101 CacheAs(instance.GetType(), info, instance, true); 101 102 } 102 103 ··· 138 139 { 139 140 if (allowValueTypes) 140 141 return; 142 + 141 143 throw new ArgumentNullException(nameof(instance)); 142 144 } 143 145 ··· 159 161 160 162 cache[info] = instance; 161 163 } 162 - 163 164 164 165 public object Get(Type type) 165 166 => Get(type, default);
+1
osu.Framework/Allocation/IReadOnlyDependencyContainer.cs
··· 78 78 var result = container.Get(typeof(T), info); 79 79 if (result == null) 80 80 return default; 81 + 81 82 return (T)container.Get(typeof(T), info); 82 83 } 83 84
+4 -1
osu.Framework/Allocation/InvokeOnDisposal.cs
··· 21 21 /// Constructs a new instance, capturing the given action to be run during disposal. 22 22 /// </summary> 23 23 /// <param name="action">The action to invoke during disposal.</param> 24 - public InvokeOnDisposal(Action action) => this.action = action ?? throw new ArgumentNullException(nameof(action)); 24 + public InvokeOnDisposal(Action action) 25 + { 26 + this.action = action ?? throw new ArgumentNullException(nameof(action)); 27 + } 25 28 26 29 #region IDisposable Support 27 30
+4 -1
osu.Framework/Allocation/ValueInvokeOnDisposal.cs
··· 23 23 /// Constructs a new instance, capturing the given action to be run during disposal. 24 24 /// </summary> 25 25 /// <param name="action">The action to invoke during disposal.</param> 26 - public ValueInvokeOnDisposal(Action action) => this.action = action ?? throw new ArgumentNullException(nameof(action)); 26 + public ValueInvokeOnDisposal(Action action) 27 + { 28 + this.action = action ?? throw new ArgumentNullException(nameof(action)); 29 + } 27 30 28 31 #region IDisposable Support 29 32
+1
osu.Framework/Audio/AudioCollectionManager.cs
··· 25 25 EnqueueAction(delegate 26 26 { 27 27 if (Items.Contains(item)) return; 28 + 28 29 Items.Add(item); 29 30 }); 30 31 }
+1 -4
osu.Framework/Audio/Sample/SampleManager.cs
··· 65 65 base.UpdateState(); 66 66 } 67 67 68 - public Stream GetStream(string name) 69 - { 70 - return store.GetStream(name); 71 - } 68 + public Stream GetStream(string name) => store.GetStream(name); 72 69 } 73 70 }
+1
osu.Framework/Audio/Track/Track.cs
··· 87 87 { 88 88 if (value < 0) 89 89 throw new ArgumentException("Track length must be >= 0.", nameof(value)); 90 + 90 91 length = value; 91 92 } 92 93 }
+5 -1
osu.Framework/Audio/Track/Waveform.cs
··· 27 27 /// The data stream is iteratively decoded to provide this many points per iteration so as to not exceed BASS's internal buffer size. 28 28 /// </summary> 29 29 private const int points_per_iteration = 100000; 30 + 30 31 private const int bytes_per_sample = 4; 31 32 32 33 /// <summary> ··· 201 202 int kernelWidth = (int)(pointsPerGeneratedPoint * kernel_width_factor) + 1; 202 203 203 204 float[] filter = new float[kernelWidth + 1]; 204 - for (int i = 0; i < filter.Length; ++i) { 205 + 206 + for (int i = 0; i < filter.Length; ++i) 207 + { 205 208 filter[i] = (float)Blur.EvalGaussian(i, pointsPerGeneratedPoint); 206 209 } 207 210 ··· 299 302 { 300 303 if (isDisposed) 301 304 return; 305 + 302 306 isDisposed = true; 303 307 304 308 cancelSource?.Cancel();
+6 -5
osu.Framework/Bindables/Bindable.cs
··· 127 127 { 128 128 if (!(them is Bindable<T> tThem)) 129 129 throw new InvalidCastException($"Can't bind to a bindable of type {them.GetType()} from a bindable of type {GetType()}."); 130 + 130 131 BindTo(tThem); 131 132 } 132 133 ··· 134 135 { 135 136 if (!(them is Bindable<T> tThem)) 136 137 throw new InvalidCastException($"Can't bind to a bindable of type {them.GetType()} from a bindable of type {GetType()}."); 138 + 137 139 BindTo(tThem); 138 140 } 139 141 ··· 143 145 /// </summary> 144 146 public Bindable<T> BindTarget 145 147 { 146 - set { BindTo(value); } 148 + set => BindTo(value); 147 149 } 148 150 149 151 /// <summary> ··· 235 237 Bindings?.ForEachAlive(b => 236 238 { 237 239 if (b == source) return; 240 + 238 241 b.SetValue(previousValue, value, bypassChecks, this); 239 242 }); 240 243 if (EqualityComparer<T>.Default.Equals(beforePropagation, value)) ··· 249 252 Bindings?.ForEachAlive(b => 250 253 { 251 254 if (b == source) return; 255 + 252 256 b.SetDisabled(disabled, bypassChecks, this); 253 257 }); 254 258 if (beforePropagation == disabled) ··· 299 303 300 304 public string Description { get; set; } 301 305 302 - public override string ToString() 303 - { 304 - return value?.ToString() ?? string.Empty; 305 - } 306 + public override string ToString() => value?.ToString() ?? string.Empty; 306 307 307 308 /// <summary> 308 309 /// Create an unbound clone of this bindable.
+20 -1
osu.Framework/Bindables/BindableNumber.cs
··· 46 46 precision = DefaultPrecision; 47 47 } 48 48 49 - 50 49 private T precision; 51 50 52 51 public T Precision ··· 243 242 case TypeCode.Byte: 244 243 var byteBindable = this as BindableNumber<byte>; 245 244 if (byteBindable == null) throw new ArgumentNullException(nameof(byteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 245 + 246 246 byteBindable.Value = Convert.ToByte(val); 247 247 break; 248 248 case TypeCode.SByte: 249 249 var sbyteBindable = this as BindableNumber<sbyte>; 250 250 if (sbyteBindable == null) throw new ArgumentNullException(nameof(sbyteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 251 + 251 252 sbyteBindable.Value = Convert.ToSByte(val); 252 253 break; 253 254 case TypeCode.UInt16: 254 255 var ushortBindable = this as BindableNumber<ushort>; 255 256 if (ushortBindable == null) throw new ArgumentNullException(nameof(ushortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 257 + 256 258 ushortBindable.Value = Convert.ToUInt16(val); 257 259 break; 258 260 case TypeCode.Int16: 259 261 var shortBindable = this as BindableNumber<short>; 260 262 if (shortBindable == null) throw new ArgumentNullException(nameof(shortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 263 + 261 264 shortBindable.Value = Convert.ToInt16(val); 262 265 break; 263 266 case TypeCode.UInt32: 264 267 var uintBindable = this as BindableNumber<uint>; 265 268 if (uintBindable == null) throw new ArgumentNullException(nameof(uintBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 269 + 266 270 uintBindable.Value = Convert.ToUInt32(val); 267 271 break; 268 272 case TypeCode.Int32: 269 273 var intBindable = this as BindableNumber<int>; 270 274 if (intBindable == null) throw new ArgumentNullException(nameof(intBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 275 + 271 276 intBindable.Value = Convert.ToInt32(val); 272 277 break; 273 278 case TypeCode.UInt64: 274 279 var ulongBindable = this as BindableNumber<ulong>; 275 280 if (ulongBindable == null) throw new ArgumentNullException(nameof(ulongBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 281 + 276 282 ulongBindable.Value = Convert.ToUInt64(val); 277 283 break; 278 284 case TypeCode.Int64: 279 285 var longBindable = this as BindableNumber<long>; 280 286 if (longBindable == null) throw new ArgumentNullException(nameof(longBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 287 + 281 288 longBindable.Value = Convert.ToInt64(val); 282 289 break; 283 290 case TypeCode.Single: 284 291 var floatBindable = this as BindableNumber<float>; 285 292 if (floatBindable == null) throw new ArgumentNullException(nameof(floatBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 293 + 286 294 floatBindable.Value = Convert.ToSingle(val); 287 295 break; 288 296 case TypeCode.Double: 289 297 var doubleBindable = this as BindableNumber<double>; 290 298 if (doubleBindable == null) throw new ArgumentNullException(nameof(doubleBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 299 + 291 300 doubleBindable.Value = Convert.ToDouble(val); 292 301 break; 293 302 } ··· 301 310 case TypeCode.Byte: 302 311 var byteBindable = this as BindableNumber<byte>; 303 312 if (byteBindable == null) throw new ArgumentNullException(nameof(byteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 313 + 304 314 byteBindable.Value += Convert.ToByte(val); 305 315 break; 306 316 case TypeCode.SByte: 307 317 var sbyteBindable = this as BindableNumber<sbyte>; 308 318 if (sbyteBindable == null) throw new ArgumentNullException(nameof(sbyteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 319 + 309 320 sbyteBindable.Value += Convert.ToSByte(val); 310 321 break; 311 322 case TypeCode.UInt16: 312 323 var ushortBindable = this as BindableNumber<ushort>; 313 324 if (ushortBindable == null) throw new ArgumentNullException(nameof(ushortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 325 + 314 326 ushortBindable.Value += Convert.ToUInt16(val); 315 327 break; 316 328 case TypeCode.Int16: 317 329 var shortBindable = this as BindableNumber<short>; 318 330 if (shortBindable == null) throw new ArgumentNullException(nameof(shortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 331 + 319 332 shortBindable.Value += Convert.ToInt16(val); 320 333 break; 321 334 case TypeCode.UInt32: 322 335 var uintBindable = this as BindableNumber<uint>; 323 336 if (uintBindable == null) throw new ArgumentNullException(nameof(uintBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 337 + 324 338 uintBindable.Value += Convert.ToUInt32(val); 325 339 break; 326 340 case TypeCode.Int32: 327 341 var intBindable = this as BindableNumber<int>; 328 342 if (intBindable == null) throw new ArgumentNullException(nameof(intBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 343 + 329 344 intBindable.Value += Convert.ToInt32(val); 330 345 break; 331 346 case TypeCode.UInt64: 332 347 var ulongBindable = this as BindableNumber<ulong>; 333 348 if (ulongBindable == null) throw new ArgumentNullException(nameof(ulongBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 349 + 334 350 ulongBindable.Value += Convert.ToUInt64(val); 335 351 break; 336 352 case TypeCode.Int64: 337 353 var longBindable = this as BindableNumber<long>; 338 354 if (longBindable == null) throw new ArgumentNullException(nameof(longBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 355 + 339 356 longBindable.Value += Convert.ToInt64(val); 340 357 break; 341 358 case TypeCode.Single: 342 359 var floatBindable = this as BindableNumber<float>; 343 360 if (floatBindable == null) throw new ArgumentNullException(nameof(floatBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 361 + 344 362 floatBindable.Value += Convert.ToSingle(val); 345 363 break; 346 364 case TypeCode.Double: 347 365 var doubleBindable = this as BindableNumber<double>; 348 366 if (doubleBindable == null) throw new ArgumentNullException(nameof(doubleBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 367 + 349 368 doubleBindable.Value += Convert.ToDouble(val); 350 369 break; 351 370 }
+2 -4
osu.Framework/Bindables/BindableSize.cs
··· 66 66 } 67 67 } 68 68 69 - private static Size clamp(Size value, Size minValue, Size maxValue) 70 - { 71 - return new Size( 69 + private static Size clamp(Size value, Size minValue, Size maxValue) => 70 + new Size( 72 71 Math.Max(minValue.Width, Math.Min(value.Width, maxValue.Width)), 73 72 Math.Max(minValue.Height, Math.Min(value.Height, maxValue.Height)) 74 73 ); 75 - } 76 74 } 77 75 }
+1
osu.Framework/Bindables/LeasedBindable.cs
··· 82 82 checkValid(); 83 83 84 84 if (Disabled == value) return; 85 + 85 86 SetDisabled(value, true); 86 87 } 87 88 }
+1
osu.Framework/Caching/Cached.cs
··· 21 21 { 22 22 if (!isValid) 23 23 throw new InvalidOperationException($"May not query {nameof(Value)} of an invalid {nameof(Cached<T>)}."); 24 + 24 25 return value; 25 26 } 26 27
+6 -16
osu.Framework/Extensions/Color4Extensions/Color4Extensions.cs
··· 10 10 { 11 11 public const double GAMMA = 2.4; 12 12 13 - public static double ToLinear(double color) 14 - { 15 - return color <= 0.04045 ? color / 12.92 : Math.Pow((color + 0.055) / 1.055, GAMMA); 16 - } 13 + public static double ToLinear(double color) => color <= 0.04045 ? color / 12.92 : Math.Pow((color + 0.055) / 1.055, GAMMA); 17 14 18 - public static double ToSRGB(double color) 19 - { 20 - return color < 0.0031308 ? 12.92 * color : 1.055 * Math.Pow(color, 1.0 / GAMMA) - 0.055; 21 - } 15 + public static double ToSRGB(double color) => color < 0.0031308 ? 12.92 * color : 1.055 * Math.Pow(color, 1.0 / GAMMA) - 0.055; 22 16 23 17 public static Color4 Opacity(this Color4 color, float a) => new Color4(color.R, color.G, color.B, a); 24 18 25 19 public static Color4 Opacity(this Color4 color, byte a) => new Color4(color.R, color.G, color.B, a / 255f); 26 20 27 - public static Color4 ToLinear(this Color4 colour) 28 - { 29 - return new Color4( 21 + public static Color4 ToLinear(this Color4 colour) => 22 + new Color4( 30 23 (float)ToLinear(colour.R), 31 24 (float)ToLinear(colour.G), 32 25 (float)ToLinear(colour.B), 33 26 colour.A); 34 - } 35 27 36 - public static Color4 ToSRGB(this Color4 colour) 37 - { 38 - return new Color4( 28 + public static Color4 ToSRGB(this Color4 colour) => 29 + new Color4( 39 30 (float)ToSRGB(colour.R), 40 31 (float)ToSRGB(colour.G), 41 32 (float)ToSRGB(colour.B), 42 33 colour.A); 43 - } 44 34 45 35 public static Color4 MultiplySRGB(Color4 first, Color4 second) 46 36 {
+15 -21
osu.Framework/Extensions/ExtensionMethods.cs
··· 75 75 /// <param name="dictionary">The dictionary.</param> 76 76 /// <param name="lookup">The lookup key.</param> 77 77 /// <returns></returns> 78 - public static TValue GetOrDefault<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey lookup) 79 - { 80 - return dictionary.TryGetValue(lookup, out TValue outVal) ? outVal : default; 81 - } 78 + public static TValue GetOrDefault<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey lookup) => dictionary.TryGetValue(lookup, out TValue outVal) ? outVal : default; 82 79 83 - public static bool IsValidIndex<T>(this List<T> list, int index) 84 - { 85 - return index >= 0 && index < list.Count; 86 - } 80 + public static bool IsValidIndex<T>(this List<T> list, int index) => index >= 0 && index < list.Count; 87 81 88 82 /// <summary> 89 83 /// Compares every item in list to given list. ··· 137 131 138 132 var rectangular = new T[rows, cols]; 139 133 for (int r = 0; r < rows; r++) 140 - for (int c = 0; c < cols; c++) 141 - { 142 - if (jagged[r] == null) 143 - continue; 134 + for (int c = 0; c < cols; c++) 135 + { 136 + if (jagged[r] == null) 137 + continue; 144 138 145 - if (c >= jagged[r].Length) 146 - continue; 139 + if (c >= jagged[r].Length) 140 + continue; 147 141 148 - rectangular[r, c] = jagged[r][c]; 149 - } 142 + rectangular[r, c] = jagged[r][c]; 143 + } 150 144 151 145 return rectangular; 152 146 } ··· 180 174 /// <returns>The inverted array. This is always a square array.</returns> 181 175 public static T[][] Invert<T>(this T[][] array) => array.ToRectangular().Invert().ToJagged(); 182 176 183 - public static string ToResolutionString(this Size size) 184 - { 185 - return size.Width.ToString() + 'x' + size.Height; 186 - } 177 + public static string ToResolutionString(this Size size) => size.Width.ToString() + 'x' + size.Height; 187 178 188 179 public static void WriteLineExplicit(this Stream s, string str = @"") 189 180 { ··· 208 199 public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly) 209 200 { 210 201 if (assembly == null) throw new ArgumentNullException(nameof(assembly)); 202 + 211 203 try 212 204 { 213 205 return assembly.GetTypes(); ··· 225 217 public static void ThrowIfFaulted(this Task task) 226 218 { 227 219 if (!task.IsFaulted) return; 220 + 228 221 throw task.Exception ?? new Exception("Task failed."); 229 222 } 230 223 ··· 265 258 public static DisplayIndex GetIndex(this DisplayDevice display) 266 259 { 267 260 if (display == null) return DisplayIndex.Default; 268 - for (int i = 0; ; i++) 261 + 262 + for (int i = 0;; i++) 269 263 { 270 264 var device = DisplayDevice.GetDisplay((DisplayIndex)i); 271 265 if (device == null) return DisplayIndex.Default;
+1
osu.Framework/Extensions/TypeExtensions/TypeExtensions.cs
··· 45 45 while (t != null && t != typeof(object)) 46 46 { 47 47 yield return t; 48 + 48 49 t = t.BaseType; 49 50 } 50 51 }
+1 -4
osu.Framework/Game.cs
··· 225 225 Host.Exit(); 226 226 } 227 227 228 - protected virtual bool OnExiting() 229 - { 230 - return false; 231 - } 228 + protected virtual bool OnExiting() => false; 232 229 233 230 /// <summary> 234 231 /// Called before a frame cycle has started (Update and Draw).
+24 -19
osu.Framework/Graphics/Audio/WaveformGraph.cs
··· 55 55 56 56 if (resolution == value) 57 57 return; 58 + 58 59 resolution = value; 59 60 generate(); 60 61 } ··· 91 92 { 92 93 if (lowColour == value) 93 94 return; 95 + 94 96 lowColour = value; 95 97 96 98 Invalidate(Invalidation.DrawNode); ··· 110 112 { 111 113 if (midColour == value) 112 114 return; 115 + 113 116 midColour = value; 114 117 115 118 Invalidate(Invalidation.DrawNode); ··· 129 132 { 130 133 if (highColour == value) 131 134 return; 135 + 132 136 highColour = value; 133 137 134 138 Invalidate(Invalidation.DrawNode); ··· 222 226 223 227 public IReadOnlyList<WaveformPoint> Points 224 228 { 225 - get { return points; } 229 + get => points; 226 230 set 227 231 { 228 232 points = value; ··· 264 268 265 269 if (rightX < localMaskingRectangle.Left) 266 270 continue; 271 + 267 272 if (leftX > localMaskingRectangle.Right) 268 273 break; // X is always increasing 269 274 ··· 282 287 { 283 288 default: 284 289 case 2: 285 - { 286 - float height = DrawSize.Y / 2; 287 - quadToDraw = new Quad( 288 - new Vector2(leftX, height - points[i].Amplitude[0] * height), 289 - new Vector2(rightX, height - points[i + 1].Amplitude[0] * height), 290 - new Vector2(leftX, height + points[i].Amplitude[1] * height), 291 - new Vector2(rightX, height + points[i + 1].Amplitude[1] * height) 292 - ); 293 - } 290 + { 291 + float height = DrawSize.Y / 2; 292 + quadToDraw = new Quad( 293 + new Vector2(leftX, height - points[i].Amplitude[0] * height), 294 + new Vector2(rightX, height - points[i + 1].Amplitude[0] * height), 295 + new Vector2(leftX, height + points[i].Amplitude[1] * height), 296 + new Vector2(rightX, height + points[i + 1].Amplitude[1] * height) 297 + ); 298 + } 294 299 break; 295 300 case 1: 296 - { 297 - quadToDraw = new Quad( 298 - new Vector2(leftX, DrawSize.Y - points[i].Amplitude[0] * DrawSize.Y), 299 - new Vector2(rightX, DrawSize.Y - points[i + 1].Amplitude[0] * DrawSize.Y), 300 - new Vector2(leftX, DrawSize.Y), 301 - new Vector2(rightX, DrawSize.Y) 302 - ); 303 - break; 304 - } 301 + { 302 + quadToDraw = new Quad( 303 + new Vector2(leftX, DrawSize.Y - points[i].Amplitude[0] * DrawSize.Y), 304 + new Vector2(rightX, DrawSize.Y - points[i + 1].Amplitude[0] * DrawSize.Y), 305 + new Vector2(leftX, DrawSize.Y), 306 + new Vector2(rightX, DrawSize.Y) 307 + ); 308 + break; 309 + } 305 310 } 306 311 307 312 quadToDraw *= DrawInfo.Matrix;
+3 -8
osu.Framework/Graphics/Colour/ColourInfo.cs
··· 70 70 { 71 71 if (!HasSingleColour) 72 72 throw new InvalidOperationException("Attempted to read single colour from multi-colour ColourInfo."); 73 + 73 74 return TopLeft; 74 75 } 75 76 ··· 164 165 return other.HasSingleColour && TopLeft.Equals(other.TopLeft); 165 166 } 166 167 167 - public bool Equals(SRGBColour other) 168 - { 169 - return HasSingleColour && TopLeft.Equals(other); 170 - } 168 + public bool Equals(SRGBColour other) => HasSingleColour && TopLeft.Equals(other); 171 169 172 170 /// <summary> 173 171 /// The average colour of all corners. ··· 200 198 } 201 199 } 202 200 203 - public override string ToString() => 204 - HasSingleColour ? 205 - $@"{TopLeft} (Single)" : 206 - $@"{TopLeft}, {TopRight}, {BottomLeft}, {BottomRight}"; 201 + public override string ToString() => HasSingleColour ? $@"{TopLeft} (Single)" : $@"{TopLeft}, {TopRight}, {BottomLeft}, {BottomRight}"; 207 202 208 203 public static implicit operator ColourInfo(SRGBColour colour) => SingleColour(colour); 209 204 public static implicit operator SRGBColour(ColourInfo colour) => colour.singleColour;
+11
osu.Framework/Graphics/Containers/CompositeDrawable.cs
··· 331 331 332 332 int i = y.Depth.CompareTo(x.Depth); 333 333 if (i != 0) return i; 334 + 334 335 return x.ChildID.CompareTo(y.ChildID); 335 336 } 336 337 ··· 347 348 348 349 int i = y.Depth.CompareTo(x.Depth); 349 350 if (i != 0) return i; 351 + 350 352 return y.ChildID.CompareTo(x.ChildID); 351 353 } 352 354 ··· 568 570 case LoadState.Loading: 569 571 if (Thread.CurrentThread != LoadThread) 570 572 throw new InvalidThreadForChildMutationException(LoadState, "not on the load thread"); 573 + 571 574 break; 572 575 case LoadState.Ready: 573 576 // Allow mutating from the load thread since parenting containers may still be in the loading state 574 577 if (Thread.CurrentThread != LoadThread && !ThreadSafety.IsUpdateThread) 575 578 throw new InvalidThreadForChildMutationException(LoadState, "not on the load or update threads"); 579 + 576 580 break; 577 581 case LoadState.Loaded: 578 582 if (!ThreadSafety.IsUpdateThread) 579 583 throw new InvalidThreadForChildMutationException(LoadState, "not on the update thread"); 584 + 580 585 break; 581 586 } 582 587 } ··· 985 990 { 986 991 if (forceLocalVertexBatch == value) 987 992 return; 993 + 988 994 forceLocalVertexBatch = value; 989 995 990 996 Invalidate(Invalidation.DrawNode); ··· 1100 1106 { 1101 1107 if (base.RemoveCompletedTransforms == value) 1102 1108 return; 1109 + 1103 1110 base.RemoveCompletedTransforms = value; 1104 1111 1105 1112 foreach (var c in internalChildren) ··· 1206 1213 // Select a cheaper contains method when we don't need rounded edges. 1207 1214 if (cRadius == 0.0f) 1208 1215 return base.Contains(screenSpacePos); 1216 + 1209 1217 return DrawRectangle.Shrink(cRadius).DistanceSquared(ToLocalSpace(screenSpacePos)) <= cRadius * cRadius; 1210 1218 } 1211 1219 ··· 1569 1577 { 1570 1578 if ((AutoSizeAxes & Axes.X) != 0) 1571 1579 throw new InvalidOperationException($"The width of a {nameof(CompositeDrawable)} with {nameof(AutoSizeAxes)} should only be manually set if it is relative to its parent."); 1580 + 1572 1581 base.Width = value; 1573 1582 } 1574 1583 } ··· 1586 1595 { 1587 1596 if ((AutoSizeAxes & Axes.Y) != 0) 1588 1597 throw new InvalidOperationException($"The height of a {nameof(CompositeDrawable)} with {nameof(AutoSizeAxes)} should only be manually set if it is relative to its parent."); 1598 + 1589 1599 base.Height = value; 1590 1600 } 1591 1601 } ··· 1605 1615 { 1606 1616 if ((AutoSizeAxes & Axes.Both) != 0) 1607 1617 throw new InvalidOperationException($"The Size of a {nameof(CompositeDrawable)} with {nameof(AutoSizeAxes)} should only be manually set if it is relative to its parent."); 1618 + 1608 1619 base.Size = value; 1609 1620 } 1610 1621 }
+3
osu.Framework/Graphics/Containers/CustomizableTextContainer.cs
··· 144 144 145 145 placeholderDrawable = (Drawable)cb.DynamicInvoke(args); 146 146 } 147 + 147 148 index = placeholderEnd + 1; 148 149 } 149 150 } ··· 153 154 strPiece = str.Substring(index); 154 155 index = str.Length; 155 156 } 157 + 156 158 // unescape stuff 157 159 strPiece = strPiece.Replace("[[", "[").Replace("]]", "]"); 158 160 sprites.AddRange(AddString(new TextLine(strPiece, line.CreationParameters), newLineIsParagraph)); ··· 161 163 { 162 164 if (placeholderDrawable.Parent != null) 163 165 throw new ArgumentException("All icons used by a customizable text container must not have a parent. If you get this error message it means one of your icon factories created a drawable that was already added to another parent, or you used a drawable as a placeholder that already has another parent or you used an index-based placeholder (like [2]) more than once."); 166 + 164 167 AddInternal(placeholderDrawable); 165 168 } 166 169 }
+1
osu.Framework/Graphics/Containers/DelayedLoadWrapper.cs
··· 67 67 protected void BeginDelayedLoad() 68 68 { 69 69 if (loadTask != null) throw new InvalidOperationException("Load is already started!"); 70 + 70 71 loadTask = LoadComponentAsync(Content, EndDelayedLoad); 71 72 } 72 73
+3
osu.Framework/Graphics/Containers/FillFlowContainer.cs
··· 228 228 throw new InvalidOperationException( 229 229 $"All drawables in a {nameof(FillFlowContainer)} must use the same RelativeAnchorPosition for the given {nameof(FillDirection)}({Direction}) ({ourRelativeAnchor.Y} != {c.RelativeAnchorPosition.Y}). " 230 230 + $"Consider using multiple instances of {nameof(FillFlowContainer)} if this is intentional."); 231 + 231 232 break; 232 233 case FillDirection.Horizontal: 233 234 if (c.RelativeAnchorPosition.X != ourRelativeAnchor.X) 234 235 throw new InvalidOperationException( 235 236 $"All drawables in a {nameof(FillFlowContainer)} must use the same RelativeAnchorPosition for the given {nameof(FillDirection)}({Direction}) ({ourRelativeAnchor.X} != {c.RelativeAnchorPosition.X}). " 236 237 + $"Consider using multiple instances of {nameof(FillFlowContainer)} if this is intentional."); 238 + 237 239 break; 238 240 default: 239 241 if (c.RelativeAnchorPosition != ourRelativeAnchor) 240 242 throw new InvalidOperationException( 241 243 $"All drawables in a {nameof(FillFlowContainer)} must use the same RelativeAnchorPosition for the given {nameof(FillDirection)}({Direction}) ({ourRelativeAnchor} != {c.RelativeAnchorPosition}). " 242 244 + $"Consider using multiple instances of {nameof(FillFlowContainer)} if this is intentional."); 245 + 243 246 break; 244 247 } 245 248
+2 -6
osu.Framework/Graphics/Containers/FlowContainer.cs
··· 33 33 public float LayoutDuration 34 34 { 35 35 get => AutoSizeDuration * 2; 36 - set 37 - { 38 - //coupling with autosizeduration allows us to smoothly transition our size 39 - //when no children are left to dictate autosize. 40 - AutoSizeDuration = value / 2; 41 - } 36 + set => AutoSizeDuration = value / 2; 42 37 } 43 38 44 39 private Vector2 maximumSize; ··· 115 110 { 116 111 if (!layoutChildren.ContainsKey(drawable)) 117 112 throw new InvalidOperationException($"Cannot change layout position of drawable which is not contained within this {nameof(FlowContainer<T>)}."); 113 + 118 114 layoutChildren[drawable] = newPosition; 119 115 InvalidateLayout(); 120 116 }
+4 -3
osu.Framework/Graphics/Containers/Markdown/MarkdownContainer.cs
··· 33 33 { 34 34 if (text == value) 35 35 return; 36 + 36 37 text = value; 37 38 38 39 contentCache.Invalidate(); ··· 190 191 /// <param name="level">The level in the document of <paramref name="paragraphBlock"/>. 191 192 /// 0 for the root level, 1 for first-level items in a list, 2 for second-level items in a list, etc.</param> 192 193 /// <returns>The visualiser.</returns> 193 - protected virtual MarkdownParagraph CreateParagraph(ParagraphBlock paragraphBlock, int level) => new MarkdownParagraph(paragraphBlock, level); 194 + protected virtual MarkdownParagraph CreateParagraph(ParagraphBlock paragraphBlock, int level) => new MarkdownParagraph(paragraphBlock); 194 195 195 196 /// <summary> 196 197 /// Creates the visualiser for a <see cref="QuoteBlock"/>. ··· 217 218 /// Creates the visualiser for a <see cref="ListBlock"/>. 218 219 /// </summary> 219 220 /// <returns>The visualiser.</returns> 220 - protected virtual MarkdownList CreateList(ListBlock listBlock) => new MarkdownList(listBlock); 221 + protected virtual MarkdownList CreateList(ListBlock listBlock) => new MarkdownList(); 221 222 222 223 /// <summary> 223 224 /// Creates the visualiser for a horizontal separator. 224 225 /// </summary> 225 226 /// <returns>The visualiser.</returns> 226 - protected virtual MarkdownSeparator CreateSeparator(ThematicBreakBlock thematicBlock) => new MarkdownSeparator(thematicBlock); 227 + protected virtual MarkdownSeparator CreateSeparator(ThematicBreakBlock thematicBlock) => new MarkdownSeparator(); 227 228 228 229 /// <summary> 229 230 /// Creates the visualiser for an element that isn't implemented.
+1 -2
osu.Framework/Graphics/Containers/Markdown/MarkdownList.cs
··· 1 1 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2 2 // See the LICENCE file in the repository root for full licence text. 3 3 4 - using Markdig.Syntax; 5 4 using osuTK; 6 5 7 6 namespace osu.Framework.Graphics.Containers.Markdown ··· 15 14 /// </code> 16 15 public class MarkdownList : FillFlowContainer 17 16 { 18 - public MarkdownList(ListBlock listBlock) 17 + public MarkdownList() 19 18 { 20 19 AutoSizeAxes = Axes.Y; 21 20 RelativeSizeAxes = Axes.X;
+1 -1
osu.Framework/Graphics/Containers/Markdown/MarkdownParagraph.cs
··· 16 16 [Resolved] 17 17 private IMarkdownTextFlowComponent parentFlowComponent { get; set; } 18 18 19 - public MarkdownParagraph(ParagraphBlock paragraphBlock, int level) 19 + public MarkdownParagraph(ParagraphBlock paragraphBlock) 20 20 { 21 21 this.paragraphBlock = paragraphBlock; 22 22
+1 -2
osu.Framework/Graphics/Containers/Markdown/MarkdownSeparator.cs
··· 1 1 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2 2 // See the LICENCE file in the repository root for full licence text. 3 3 4 - using Markdig.Syntax; 5 4 using osu.Framework.Allocation; 6 5 using osu.Framework.Graphics.Shapes; 7 6 using osuTK.Graphics; ··· 16 15 /// </code> 17 16 public class MarkdownSeparator : CompositeDrawable 18 17 { 19 - public MarkdownSeparator(ThematicBreakBlock thematicBlock) 18 + public MarkdownSeparator() 20 19 { 21 20 AutoSizeAxes = Axes.Y; 22 21 RelativeSizeAxes = Axes.X;
+1 -4
osu.Framework/Graphics/Containers/Markdown/MarkdownTable.cs
··· 144 144 tableContainer.RowDimensions = rowDefinitions; 145 145 } 146 146 147 - protected virtual MarkdownTableCell CreateTableCell(TableCell cell, TableColumnDefinition definition, bool isHeading) 148 - { 149 - return new MarkdownTableCell(cell, definition, isHeading); 150 - } 147 + protected virtual MarkdownTableCell CreateTableCell(TableCell cell, TableColumnDefinition definition, bool isHeading) => new MarkdownTableCell(cell, definition); 151 148 152 149 private class TableContainer : GridContainer 153 150 {
+1 -1
osu.Framework/Graphics/Containers/Markdown/MarkdownTableCell.cs
··· 28 28 [Resolved] 29 29 private IMarkdownTextFlowComponent parentFlowComponent { get; set; } 30 30 31 - public MarkdownTableCell(TableCell cell, TableColumnDefinition definition, bool isHeading) 31 + public MarkdownTableCell(TableCell cell, TableColumnDefinition definition) 32 32 { 33 33 this.cell = cell; 34 34 this.definition = definition;
+7
osu.Framework/Graphics/Containers/TextFlowContainer.cs
··· 32 32 set 33 33 { 34 34 if (value == firstLineIndent) return; 35 + 35 36 firstLineIndent = value; 36 37 37 38 layout.Invalidate(); ··· 49 50 set 50 51 { 51 52 if (value == contentIndent) return; 53 + 52 54 contentIndent = value; 53 55 54 56 layout.Invalidate(); ··· 67 69 set 68 70 { 69 71 if (value == paragraphSpacing) return; 72 + 70 73 paragraphSpacing = value; 71 74 72 75 layout.Invalidate(); ··· 85 88 set 86 89 { 87 90 if (value == lineSpacing) return; 91 + 88 92 lineSpacing = value; 89 93 90 94 layout.Invalidate(); ··· 103 107 { 104 108 if (textAnchor == value) 105 109 return; 110 + 106 111 textAnchor = value; 107 112 108 113 layout.Invalidate(); ··· 189 194 // the right-most word, whereas it should still be flowed left-to-right. This is achieved by reversing the comparator. 190 195 if (TextAnchor.HasFlag(Anchor.x2)) 191 196 return base.Compare(y, x); 197 + 192 198 return base.Compare(x, y); 193 199 } 194 200 ··· 345 351 childrenByLine.Add(curLine); 346 352 curLine = new List<Drawable>(); 347 353 } 354 + 348 355 curLine.Add(c); 349 356 } 350 357 }
+1
osu.Framework/Graphics/Containers/VisibilityContainer.cs
··· 40 40 set 41 41 { 42 42 if (value == state) return; 43 + 43 44 state = value; 44 45 45 46 if (!IsLoaded) return;
+2 -3
osu.Framework/Graphics/Cursor/CursorEffectContainer.cs
··· 76 76 // are still our own responsibility to handle. 77 77 nestedTtcChildDrawables.UnionWith( 78 78 ((IEnumerable<IDrawable>)newChildDrawables).Reverse() 79 - .SkipWhile(d => d.Parent == this || !(d.Parent is TSelf) && !nestedTtcChildDrawables.Contains(d.Parent))); 79 + .SkipWhile(d => d.Parent == this || !(d.Parent is TSelf) && !nestedTtcChildDrawables.Contains(d.Parent))); 80 80 81 81 // Ignore drawables whose effects are managed by a nested effect container. 82 82 if (nestedTtcChildDrawables.Contains(candidate)) 83 83 continue; 84 84 85 - TTarget target = candidate as TTarget; 86 - if (target != null && target.IsHovered) 85 + if (candidate is TTarget target && target.IsHovered) 87 86 // We found a valid candidate; keep track of it 88 87 targetChildren.Add(target); 89 88 }
+6 -1
osu.Framework/Graphics/Cursor/TooltipContainer.cs
··· 164 164 private double lastRecordedPositionTime; 165 165 166 166 private IHasTooltip lastCandidate; 167 + 167 168 /// <summary> 168 169 /// Determines which drawable should currently receive a tooltip, taking into account 169 170 /// <see cref="AppearDelay"/> and <see cref="AppearRadius"/>. Returns null if no valid ··· 183 184 recentMousePositions.Clear(); 184 185 lastCandidate = targetCandidate; 185 186 } 187 + 186 188 if (targetCandidate == null) 187 189 return null; 188 190 ··· 203 205 // we can skip this if the appear-delay is set to 0, since then tooltips can appear instantly and we don't need to wait to record enough positions. 204 206 if (appearDelay > 0 && (recentMousePositions.Count == 0 || lastRecordedPositionTime - recentMousePositions[0].Time < appearDelay - positionRecordInterval)) 205 207 return null; 208 + 206 209 recentMousePositions.RemoveAll(t => Time.Current - t.Time > appearDelay); 207 210 208 211 // For determining whether to show a tooltip we first select only those positions ··· 304 307 }; 305 308 } 306 309 307 - public virtual void Refresh() { } 310 + public virtual void Refresh() 311 + { 312 + } 308 313 309 314 /// <summary> 310 315 /// Called whenever the tooltip appears. When overriding do not forget to fade in.
+12 -16
osu.Framework/Graphics/Drawable.cs
··· 165 165 private void unbindAllBindables() 166 166 { 167 167 if (unbindComplete) return; 168 + 168 169 unbindComplete = true; 169 170 170 171 foreach (var type in GetType().EnumerateBaseTypes()) ··· 942 943 set 943 944 { 944 945 if (fillMode == value) return; 946 + 945 947 fillMode = value; 946 948 947 949 Invalidate(Invalidation.DrawSize); ··· 965 967 set 966 968 { 967 969 if (shear == value) return; 970 + 968 971 if (!Validation.IsFinite(value)) throw new ArgumentException($@"{nameof(Shear)} must be finite, but is {value}."); 969 972 970 973 shear = value; ··· 984 987 set 985 988 { 986 989 if (value == rotation) return; 990 + 987 991 if (!Validation.IsFinite(value)) throw new ArgumentException($@"{nameof(Rotation)} must be finite, but is {value}."); 988 992 989 993 rotation = value; ··· 1274 1278 { 1275 1279 if (blending.Equals(value)) 1276 1280 return; 1281 + 1277 1282 blending = value; 1278 1283 1279 1284 Invalidate(Invalidation.Colour); ··· 1337 1342 set 1338 1343 { 1339 1344 if (lifetimeStart == value) return; 1345 + 1340 1346 lifetimeStart = value; 1341 1347 LifetimeChanged?.Invoke(this); 1342 1348 } ··· 1351 1357 set 1352 1358 { 1353 1359 if (lifetimeEnd == value) return; 1360 + 1354 1361 lifetimeEnd = value; 1355 1362 LifetimeChanged?.Invoke(this); 1356 1363 } ··· 1460 1467 { 1461 1468 if (proxy != null) 1462 1469 throw new InvalidOperationException("Multiple proxies are not supported."); 1470 + 1463 1471 return proxy = new ProxyDrawable(this); 1464 1472 } 1465 1473 ··· 1781 1789 /// </summary> 1782 1790 /// <param name="input">A vector in local coordinates.</param> 1783 1791 /// <returns>The vector in screen coordinates.</returns> 1784 - public Vector2 ToScreenSpace(Vector2 input) 1785 - { 1786 - return Vector2Extensions.Transform(input, DrawInfo.Matrix); 1787 - } 1792 + public Vector2 ToScreenSpace(Vector2 input) => Vector2Extensions.Transform(input, DrawInfo.Matrix); 1788 1793 1789 1794 /// <summary> 1790 1795 /// Accepts a rectangle in local coordinates and converts it to a quad in screen space. 1791 1796 /// </summary> 1792 1797 /// <param name="input">A rectangle in local coordinates.</param> 1793 1798 /// <returns>The quad in screen coordinates.</returns> 1794 - public Quad ToScreenSpace(RectangleF input) 1795 - { 1796 - return Quad.FromRectangle(input) * DrawInfo.Matrix; 1797 - } 1799 + public Quad ToScreenSpace(RectangleF input) => Quad.FromRectangle(input) * DrawInfo.Matrix; 1798 1800 1799 1801 /// <summary> 1800 1802 /// Accepts a vector in screen coordinates and converts it to coordinates in local space. 1801 1803 /// </summary> 1802 1804 /// <param name="screenSpacePos">A vector in screen coordinates.</param> 1803 1805 /// <returns>The vector in local coordinates.</returns> 1804 - public Vector2 ToLocalSpace(Vector2 screenSpacePos) 1805 - { 1806 - return Vector2Extensions.Transform(screenSpacePos, DrawInfo.MatrixInverse); 1807 - } 1806 + public Vector2 ToLocalSpace(Vector2 screenSpacePos) => Vector2Extensions.Transform(screenSpacePos, DrawInfo.MatrixInverse); 1808 1807 1809 1808 /// <summary> 1810 1809 /// Accepts a quad in screen coordinates and converts it to coordinates in local space. 1811 1810 /// </summary> 1812 1811 /// <param name="screenSpaceQuad">A quad in screen coordinates.</param> 1813 1812 /// <returns>The quad in local coordinates.</returns> 1814 - public Quad ToLocalSpace(Quad screenSpaceQuad) 1815 - { 1816 - return screenSpaceQuad * DrawInfo.MatrixInverse; 1817 - } 1813 + public Quad ToLocalSpace(Quad screenSpaceQuad) => screenSpaceQuad * DrawInfo.MatrixInverse; 1818 1814 1819 1815 #endregion 1820 1816
+9 -9
osu.Framework/Graphics/Effects/BlurEffect.cs
··· 59 59 /// </summary> 60 60 public bool CacheDrawnEffect; 61 61 62 - public BufferedContainer ApplyTo(Drawable drawable) 63 - { 64 - return new BufferedContainer 62 + public BufferedContainer ApplyTo(Drawable drawable) => 63 + new BufferedContainer 65 64 { 66 65 BlurSigma = Sigma, 67 66 BlurRotation = Rotation, ··· 73 72 74 73 CacheDrawnFrameBuffer = CacheDrawnEffect, 75 74 76 - Padding = !PadExtent ? new MarginPadding() : new MarginPadding 77 - { 78 - Horizontal = Blur.KernelSize(Sigma.X), 79 - Vertical = Blur.KernelSize(Sigma.Y), 80 - }, 75 + Padding = !PadExtent 76 + ? new MarginPadding() 77 + : new MarginPadding 78 + { 79 + Horizontal = Blur.KernelSize(Sigma.X), 80 + Vertical = Blur.KernelSize(Sigma.Y), 81 + }, 81 82 }.Wrap(drawable); 82 - } 83 83 } 84 84 }
+2 -4
osu.Framework/Graphics/Effects/EdgeEffect.cs
··· 20 20 /// </summary> 21 21 public float CornerRadius; 22 22 23 - public Container ApplyTo(Drawable drawable) 24 - { 25 - return new Container 23 + public Container ApplyTo(Drawable drawable) => 24 + new Container 26 25 { 27 26 Masking = true, 28 27 EdgeEffect = Parameters, 29 28 CornerRadius = CornerRadius, 30 29 }.Wrap(drawable); 31 - } 32 30 } 33 31 }
+1
osu.Framework/Graphics/Lines/Path.cs
··· 72 72 foreach (var t in segments) 73 73 if (t.DistanceSquaredToPoint(localPos) <= pathRadiusSquared) 74 74 return true; 75 + 75 76 return false; 76 77 } 77 78
+1
osu.Framework/Graphics/Lines/SmoothPath.cs
··· 26 26 { 27 27 if (base.PathRadius == value) 28 28 return; 29 + 29 30 base.PathRadius = value; 30 31 31 32 InvalidateTexture();
+3 -8
osu.Framework/Graphics/MarginPadding.cs
··· 80 80 Top = Left = Bottom = Right = allSides; 81 81 } 82 82 83 - public bool Equals(MarginPadding other) 84 - { 85 - return Top == other.Top && Left == other.Left && Bottom == other.Bottom && Right == other.Right; 86 - } 83 + public bool Equals(MarginPadding other) => Top == other.Top && Left == other.Left && Bottom == other.Bottom && Right == other.Right; 87 84 88 85 public override string ToString() => $@"({Top}, {Left}, {Bottom}, {Right})"; 89 86 90 - public static MarginPadding operator -(MarginPadding mp) 91 - { 92 - return new MarginPadding 87 + public static MarginPadding operator -(MarginPadding mp) => 88 + new MarginPadding 93 89 { 94 90 Left = -mp.Left, 95 91 Top = -mp.Top, 96 92 Right = -mp.Right, 97 93 Bottom = -mp.Bottom, 98 94 }; 99 - } 100 95 } 101 96 }
+6 -1
osu.Framework/Graphics/OpenGL/Buffers/FrameBuffer.cs
··· 20 20 21 21 #region Disposal 22 22 23 - ~FrameBuffer() => Dispose(false); 23 + ~FrameBuffer() 24 + { 25 + Dispose(false); 26 + } 24 27 25 28 public void Dispose() 26 29 { ··· 34 37 { 35 38 if (isDisposed) 36 39 return; 40 + 37 41 isDisposed = true; 38 42 39 43 GLWrapper.DeleteFramebuffer(frameBuffer); ··· 77 81 { 78 82 if (value == size) 79 83 return; 84 + 80 85 size = value; 81 86 82 87 Texture.Width = (int)Math.Ceiling(size.X);
+1
osu.Framework/Graphics/OpenGL/Buffers/RenderBuffer.cs
··· 40 40 { 41 41 if (isDisposed) 42 42 return; 43 + 43 44 isDisposed = true; 44 45 45 46 Unbind();
+2 -8
osu.Framework/Graphics/OpenGL/Buffers/VertexBuffer.cs
··· 89 89 { 90 90 } 91 91 92 - protected virtual int ToElements(int vertices) 93 - { 94 - return vertices; 95 - } 92 + protected virtual int ToElements(int vertices) => vertices; 96 93 97 - protected virtual int ToElementIndex(int vertexIndex) 98 - { 99 - return vertexIndex; 100 - } 94 + protected virtual int ToElementIndex(int vertexIndex) => vertexIndex; 101 95 102 96 protected abstract PrimitiveType Type { get; } 103 97
+16 -15
osu.Framework/Graphics/OpenGL/GLWrapper.cs
··· 315 315 316 316 if (Viewport == actualRect) 317 317 return; 318 + 318 319 Viewport = actualRect; 319 320 320 321 GL.Viewport(Viewport.Left, Viewport.Top, Viewport.Width, Viewport.Height); ··· 336 337 337 338 if (Viewport == actualRect) 338 339 return; 340 + 339 341 Viewport = actualRect; 340 342 341 343 GL.Viewport(Viewport.Left, Viewport.Top, Viewport.Width, Viewport.Height); ··· 356 358 ortho_stack.Push(ortho); 357 359 if (Ortho == ortho) 358 360 return; 361 + 359 362 Ortho = ortho; 360 363 361 364 ProjectionMatrix = Matrix4.CreateOrthographicOffCenter(Ortho.Left, Ortho.Right, Ortho.Bottom, Ortho.Top, -1, 1); ··· 378 381 379 382 if (Ortho == actualRect) 380 383 return; 384 + 381 385 Ortho = actualRect; 382 386 383 387 ProjectionMatrix = Matrix4.CreateOrthographicOffCenter(Ortho.Left, Ortho.Right, Ortho.Bottom, Ortho.Top, -1, 1); ··· 664 668 public bool Hollow; 665 669 public float HollowCornerRadius; 666 670 667 - public bool Equals(MaskingInfo other) 668 - { 669 - return 670 - ScreenSpaceAABB == other.ScreenSpaceAABB && 671 - MaskingRect == other.MaskingRect && 672 - ToMaskingSpace == other.ToMaskingSpace && 673 - CornerRadius == other.CornerRadius && 674 - BorderThickness == other.BorderThickness && 675 - BorderColour.Equals(other.BorderColour) && 676 - BlendRange == other.BlendRange && 677 - AlphaExponent == other.AlphaExponent && 678 - EdgeOffset == other.EdgeOffset && 679 - Hollow == other.Hollow && 680 - HollowCornerRadius == other.HollowCornerRadius; 681 - } 671 + public bool Equals(MaskingInfo other) => 672 + ScreenSpaceAABB == other.ScreenSpaceAABB && 673 + MaskingRect == other.MaskingRect && 674 + ToMaskingSpace == other.ToMaskingSpace && 675 + CornerRadius == other.CornerRadius && 676 + BorderThickness == other.BorderThickness && 677 + BorderColour.Equals(other.BorderColour) && 678 + BlendRange == other.BlendRange && 679 + AlphaExponent == other.AlphaExponent && 680 + EdgeOffset == other.EdgeOffset && 681 + Hollow == other.Hollow && 682 + HollowCornerRadius == other.HollowCornerRadius; 682 683 } 683 684 }
+2 -9
osu.Framework/Graphics/OpenGL/Textures/TextureGLSub.cs
··· 59 59 return actualBounds; 60 60 } 61 61 62 - public override RectangleF GetTextureRect(RectangleF? textureRect) 63 - { 64 - return parent.GetTextureRect(boundsInParent(textureRect)); 65 - } 62 + public override RectangleF GetTextureRect(RectangleF? textureRect) => parent.GetTextureRect(boundsInParent(textureRect)); 66 63 67 64 public override void DrawTriangle(Triangle vertexTriangle, RectangleF? textureRect, ColourInfo drawColour, Action<TexturedVertex2D> vertexAction = null, Vector2? inflationPercentage = null) 68 65 { ··· 74 71 parent.DrawQuad(vertexQuad, boundsInParent(textureRect), drawColour, vertexAction, inflationPercentage, blendRangeOverride); 75 72 } 76 73 77 - internal override bool Upload() 78 - { 79 - //no upload required; our parent does this. 80 - return false; 81 - } 74 + internal override bool Upload() => false; 82 75 83 76 public override bool Bind() 84 77 {
+5 -4
osu.Framework/Graphics/OpenGL/Vertices/ParticleVertex2D.cs
··· 14 14 { 15 15 [VertexMember(2, VertexAttribPointerType.Float)] 16 16 public Vector2 Position; 17 + 17 18 [VertexMember(4, VertexAttribPointerType.Float)] 18 19 public Color4 Colour; 20 + 19 21 [VertexMember(2, VertexAttribPointerType.Float)] 20 22 public Vector2 TexturePosition; 23 + 21 24 [VertexMember(1, VertexAttribPointerType.Float)] 22 25 public float Time; 26 + 23 27 [VertexMember(2, VertexAttribPointerType.Float)] 24 28 public Vector2 Direction; 25 29 26 - public bool Equals(ParticleVertex2D other) 27 - { 28 - return Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour) && Time.Equals(other.Time) && Direction.Equals(other.Direction); 29 - } 30 + public bool Equals(ParticleVertex2D other) => Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour) && Time.Equals(other.Time) && Direction.Equals(other.Direction); 30 31 } 31 32 }
+10 -8
osu.Framework/Graphics/OpenGL/Vertices/TexturedVertex2D.cs
··· 14 14 { 15 15 [VertexMember(2, VertexAttribPointerType.Float)] 16 16 public Vector2 Position; 17 + 17 18 [VertexMember(4, VertexAttribPointerType.Float)] 18 19 public Color4 Colour; 20 + 19 21 [VertexMember(2, VertexAttribPointerType.Float)] 20 22 public Vector2 TexturePosition; 23 + 21 24 [VertexMember(4, VertexAttribPointerType.Float)] 22 25 public Vector4 TextureRect; 26 + 23 27 [VertexMember(2, VertexAttribPointerType.Float)] 24 28 public Vector2 BlendRange; 25 29 26 - public bool Equals(TexturedVertex2D other) 27 - { 28 - return Position.Equals(other.Position) 29 - && TexturePosition.Equals(other.TexturePosition) 30 - && Colour.Equals(other.Colour) 31 - && TextureRect.Equals(other.TextureRect) 32 - && BlendRange.Equals(other.BlendRange); 33 - } 30 + public bool Equals(TexturedVertex2D other) => 31 + Position.Equals(other.Position) 32 + && TexturePosition.Equals(other.TexturePosition) 33 + && Colour.Equals(other.Colour) 34 + && TextureRect.Equals(other.TextureRect) 35 + && BlendRange.Equals(other.BlendRange); 34 36 } 35 37 }
+3 -4
osu.Framework/Graphics/OpenGL/Vertices/TexturedVertex3D.cs
··· 14 14 { 15 15 [VertexMember(3, VertexAttribPointerType.Float)] 16 16 public Vector3 Position; 17 + 17 18 [VertexMember(4, VertexAttribPointerType.Float)] 18 19 public Color4 Colour; 20 + 19 21 [VertexMember(2, VertexAttribPointerType.Float)] 20 22 public Vector2 TexturePosition; 21 23 22 - public bool Equals(TexturedVertex3D other) 23 - { 24 - return Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour); 25 - } 24 + public bool Equals(TexturedVertex3D other) => Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour); 26 25 } 27 26 }
+4 -4
osu.Framework/Graphics/OpenGL/Vertices/TimedTexturedVertex2D.cs
··· 14 14 { 15 15 [VertexMember(2, VertexAttribPointerType.Float)] 16 16 public Vector2 Position; 17 + 17 18 [VertexMember(4, VertexAttribPointerType.Float)] 18 19 public Color4 Colour; 20 + 19 21 [VertexMember(2, VertexAttribPointerType.Float)] 20 22 public Vector2 TexturePosition; 23 + 21 24 [VertexMember(1, VertexAttribPointerType.Float)] 22 25 public float Time; 23 26 24 - public bool Equals(TimedTexturedVertex2D other) 25 - { 26 - return Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour) && Time.Equals(other.Time); 27 - } 27 + public bool Equals(TimedTexturedVertex2D other) => Position.Equals(other.Position) && TexturePosition.Equals(other.TexturePosition) && Colour.Equals(other.Colour) && Time.Equals(other.Time); 28 28 } 29 29 }
+1 -4
osu.Framework/Graphics/OpenGL/Vertices/UncolouredVertex2D.cs
··· 14 14 [VertexMember(2, VertexAttribPointerType.Float)] 15 15 public Vector2 Position; 16 16 17 - public bool Equals(UncolouredVertex2D other) 18 - { 19 - return Position.Equals(other.Position); 20 - } 17 + public bool Equals(UncolouredVertex2D other) => Position.Equals(other.Position); 21 18 } 22 19 }
+2 -4
osu.Framework/Graphics/OpenGL/Vertices/Vertex2D.cs
··· 14 14 { 15 15 [VertexMember(2, VertexAttribPointerType.Float)] 16 16 public Vector2 Position; 17 + 17 18 [VertexMember(4, VertexAttribPointerType.Float)] 18 19 public Color4 Colour; 19 20 20 - public bool Equals(Vertex2D other) 21 - { 22 - return Position.Equals(other.Position) && Colour.Equals(other.Colour); 23 - } 21 + public bool Equals(Vertex2D other) => Position.Equals(other.Position) && Colour.Equals(other.Colour); 24 22 } 25 23 }
+1
osu.Framework/Graphics/OpenGL/Vertices/VertexUtils.cs
··· 54 54 { 55 55 if (amount == amountEnabledAttributes) 56 56 return; 57 + 57 58 if (amount > amountEnabledAttributes) 58 59 { 59 60 for (int i = amountEnabledAttributes; i < amount; ++i)
+1
osu.Framework/Graphics/Performance/FrameStatisticsDisplay.cs
··· 512 512 set 513 513 { 514 514 if (expanded == value) return; 515 + 515 516 expanded = value; 516 517 517 518 if (expanded)
+5 -20
osu.Framework/Graphics/Primitives/Line.cs
··· 51 51 /// <summary> 52 52 /// Distance squared from an arbitrary point p to this line. 53 53 /// </summary> 54 - public float DistanceSquaredToPoint(Vector2 p) 55 - { 56 - return Vector2Extensions.DistanceSquared(p, ClosestPointTo(p)); 57 - } 54 + public float DistanceSquaredToPoint(Vector2 p) => Vector2Extensions.DistanceSquared(p, ClosestPointTo(p)); 58 55 59 56 /// <summary> 60 57 /// Distance from an arbitrary point to this line. 61 58 /// </summary> 62 - public float DistanceToPoint(Vector2 p) 63 - { 64 - return Vector2Extensions.Distance(p, ClosestPointTo(p)); 65 - } 59 + public float DistanceToPoint(Vector2 p) => Vector2Extensions.Distance(p, ClosestPointTo(p)); 66 60 67 61 /// <summary> 68 62 /// Finds the point closest to the given point on this line. ··· 92 86 return pB; 93 87 } 94 88 95 - public Matrix4 WorldMatrix() 96 - { 97 - return Matrix4.CreateRotationZ(Theta) * Matrix4.CreateTranslation(StartPoint.X, StartPoint.Y, 0); 98 - } 89 + public Matrix4 WorldMatrix() => Matrix4.CreateRotationZ(Theta) * Matrix4.CreateTranslation(StartPoint.X, StartPoint.Y, 0); 99 90 100 91 /// <summary> 101 92 /// It's the end of the world as we know it 102 93 /// </summary> 103 - public Matrix4 EndWorldMatrix() 104 - { 105 - return Matrix4.CreateRotationZ(Theta) * Matrix4.CreateTranslation(EndPoint.X, EndPoint.Y, 0); 106 - } 94 + public Matrix4 EndWorldMatrix() => Matrix4.CreateRotationZ(Theta) * Matrix4.CreateTranslation(EndPoint.X, EndPoint.Y, 0); 107 95 108 - public object Clone() 109 - { 110 - return MemberwiseClone(); 111 - } 96 + public object Clone() => MemberwiseClone(); 112 97 } 113 98 }
+1 -4
osu.Framework/Graphics/Primitives/ProjectionRange.cs
··· 47 47 /// </summary> 48 48 /// <param name="other">The other range to test against.</param> 49 49 /// <returns>Whether the two ranges overlap.</returns> 50 - public bool Overlaps(ProjectionRange other) 51 - { 52 - return Min <= other.Max && Max >= other.Min; 53 - } 50 + public bool Overlaps(ProjectionRange other) => Min <= other.Max && Max >= other.Min; 54 51 } 55 52 }
+22 -38
osu.Framework/Graphics/Primitives/Quad.cs
··· 35 35 public static implicit operator Quad(RectangleI r) => FromRectangle(r); 36 36 public static implicit operator Quad(RectangleF r) => FromRectangle(r); 37 37 38 - public static Quad FromRectangle(RectangleF rectangle) 39 - { 40 - return new Quad(new Vector2(rectangle.Left, rectangle.Top), 38 + public static Quad FromRectangle(RectangleF rectangle) => 39 + new Quad(new Vector2(rectangle.Left, rectangle.Top), 41 40 new Vector2(rectangle.Right, rectangle.Top), 42 41 new Vector2(rectangle.Left, rectangle.Bottom), 43 42 new Vector2(rectangle.Right, rectangle.Bottom)); 44 - } 45 43 46 - public static Quad operator *(Quad r, Matrix3 m) 47 - { 48 - return new Quad( 44 + public static Quad operator *(Quad r, Matrix3 m) => 45 + new Quad( 49 46 Vector2Extensions.Transform(r.TopLeft, m), 50 47 Vector2Extensions.Transform(r.TopRight, m), 51 48 Vector2Extensions.Transform(r.BottomLeft, m), 52 49 Vector2Extensions.Transform(r.BottomRight, m)); 53 - } 54 50 55 51 public Matrix2 BasisTransform 56 52 { ··· 106 102 public Vector2[] Vertices => new[] { TopLeft, TopRight, BottomRight, BottomLeft }; 107 103 public Vector2[] AxisVertices => Vertices; 108 104 109 - public bool Contains(Vector2 pos) 110 - { 111 - return 112 - new Triangle(BottomRight, BottomLeft, TopRight).Contains(pos) || 113 - new Triangle(TopLeft, TopRight, BottomLeft).Contains(pos); 114 - } 105 + public bool Contains(Vector2 pos) => 106 + new Triangle(BottomRight, BottomLeft, TopRight).Contains(pos) || 107 + new Triangle(TopLeft, TopRight, BottomLeft).Contains(pos); 115 108 116 109 public float Area => new Triangle(BottomRight, BottomLeft, TopRight).Area + new Triangle(TopLeft, TopRight, BottomLeft).Area; 117 110 ··· 135 128 } 136 129 } 137 130 138 - public bool Intersects(IConvexPolygon other) 139 - { 140 - return (this as IConvexPolygon).Intersects(other); 141 - } 131 + public bool Intersects(IConvexPolygon other) => (this as IConvexPolygon).Intersects(other); 142 132 143 - public bool Equals(Quad other) 144 - { 145 - return 146 - TopLeft == other.TopLeft && 147 - TopRight == other.TopRight && 148 - BottomLeft == other.BottomLeft && 149 - BottomRight == other.BottomRight; 150 - } 133 + public bool Equals(Quad other) => 134 + TopLeft == other.TopLeft && 135 + TopRight == other.TopRight && 136 + BottomLeft == other.BottomLeft && 137 + BottomRight == other.BottomRight; 151 138 152 - public bool AlmostEquals(Quad other) 153 - { 154 - return 155 - Precision.AlmostEquals(TopLeft.X, other.TopLeft.X) && 156 - Precision.AlmostEquals(TopLeft.Y, other.TopLeft.Y) && 157 - Precision.AlmostEquals(TopRight.X, other.TopRight.X) && 158 - Precision.AlmostEquals(TopRight.Y, other.TopRight.Y) && 159 - Precision.AlmostEquals(BottomLeft.X, other.BottomLeft.X) && 160 - Precision.AlmostEquals(BottomLeft.Y, other.BottomLeft.Y) && 161 - Precision.AlmostEquals(BottomRight.X, other.BottomRight.X) && 162 - Precision.AlmostEquals(BottomRight.Y, other.BottomRight.Y); 163 - } 139 + public bool AlmostEquals(Quad other) => 140 + Precision.AlmostEquals(TopLeft.X, other.TopLeft.X) && 141 + Precision.AlmostEquals(TopLeft.Y, other.TopLeft.Y) && 142 + Precision.AlmostEquals(TopRight.X, other.TopRight.X) && 143 + Precision.AlmostEquals(TopRight.Y, other.TopRight.Y) && 144 + Precision.AlmostEquals(BottomLeft.X, other.BottomLeft.X) && 145 + Precision.AlmostEquals(BottomLeft.Y, other.BottomLeft.Y) && 146 + Precision.AlmostEquals(BottomRight.X, other.BottomRight.X) && 147 + Precision.AlmostEquals(BottomRight.Y, other.BottomRight.Y); 164 148 165 149 public override string ToString() => $"{TopLeft} {TopRight} {BottomLeft} {BottomRight}"; 166 150 }
+9 -12
osu.Framework/Graphics/Primitives/RectangleF.cs
··· 3 3 4 4 using System; 5 5 using System.ComponentModel; 6 + using System.Diagnostics.CodeAnalysis; 6 7 using System.Globalization; 7 8 using System.Runtime.InteropServices; 8 9 using osuTK; ··· 134 135 { 135 136 if (!(obj is RectangleF)) 136 137 return false; 138 + 137 139 RectangleF ef = (RectangleF)obj; 138 140 return ef.X == X && ef.Y == Y && ef.Width == Width && ef.Height == Height; 139 141 } ··· 186 188 /// <summary>Gets the hash code for this <see cref="T:System.Drawing.RectangleF"></see> structure. For information about the use of hash codes, see Object.GetHashCode.</summary> 187 189 /// <returns>The hash code for this <see cref="T:System.Drawing.RectangleF"></see>.</returns> 188 190 /// <filterpriority>1</filterpriority> 189 - public override int GetHashCode() 190 - { 191 - // ReSharper disable NonReadonlyMemberInGetHashCode 192 - return 193 - (int)((uint)X ^ (uint)Y << 13 | (uint)Y >> 0x13 ^ 194 - (uint)Width << 0x1a | (uint)Width >> 6 ^ 195 - (uint)Height << 7 | (uint)Height >> 0x19); 196 - // ReSharper restore NonReadonlyMemberInGetHashCode 197 - } 191 + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] 192 + public override int GetHashCode() => 193 + (int)(((uint)X ^ ((uint)Y << 13)) | (((uint)Y >> 0x13) ^ ((uint)Width << 0x1a)) | (((uint)Width >> 6) ^ ((uint)Height << 7)) | ((uint)Height >> 0x19)); 198 194 199 195 /// <summary>Gets the Area of this <see cref="RectangleF"/>.</summary> 200 196 public float Area => Width * Height; ··· 294 290 float num4 = Math.Min(a.Y + a.Height, b.Y + b.Height); 295 291 if (num2 >= x && num4 >= y) 296 292 return new RectangleF(x, y, num2 - x, num4 - y); 293 + 297 294 return Empty; 298 295 } 299 296 ··· 374 371 /// <filterpriority>1</filterpriority> 375 372 /// <PermissionSet><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" /></PermissionSet> 376 373 public override string ToString() => $"X={Math.Round(X, 3).ToString(CultureInfo.CurrentCulture)}, " 377 - + $"Y={Math.Round(Y, 3).ToString(CultureInfo.CurrentCulture)}, " 378 - + $"Width={Math.Round(Width, 3).ToString(CultureInfo.CurrentCulture)}, " 379 - + $"Height={Math.Round(Height, 3).ToString(CultureInfo.CurrentCulture)}"; 374 + + $"Y={Math.Round(Y, 3).ToString(CultureInfo.CurrentCulture)}, " 375 + + $"Width={Math.Round(Width, 3).ToString(CultureInfo.CurrentCulture)}, " 376 + + $"Height={Math.Round(Height, 3).ToString(CultureInfo.CurrentCulture)}"; 380 377 381 378 public bool Equals(RectangleF other) => X == other.X && Y == other.Y && Width == other.Width && Height == other.Height; 382 379 }
+10 -20
osu.Framework/Graphics/Primitives/RectangleI.cs
··· 3 3 4 4 using System; 5 5 using System.ComponentModel; 6 + using System.Diagnostics.CodeAnalysis; 6 7 using System.Globalization; 7 8 using System.Runtime.InteropServices; 8 9 using osuTK; ··· 41 42 /// <returns>A <see cref="osuTK.Vector2"/> that represents the upper-left corner of this <see cref="T:System.Drawing.RectangleI"></see> structure.</returns> 42 43 /// <filterpriority>1</filterpriority> 43 44 [Browsable(false)] 44 - public Vector2I Location 45 - { 46 - get { return new Vector2I(X, Y); } 47 - } 45 + public Vector2I Location => new Vector2I(X, Y); 48 46 49 47 /// <summary>Gets or sets the size of this <see cref="T:System.Drawing.RectangleI"></see>.</summary> 50 48 /// <returns>A <see cref="osuTK.Vector2"/> that represents the width and height of this <see cref="T:System.Drawing.RectangleI"></see> structure.</returns> 51 49 /// <filterpriority>1</filterpriority> 52 50 [Browsable(false)] 53 - public Vector2I Size 54 - { 55 - get { return new Vector2I(Width, Height); } 56 - } 51 + public Vector2I Size => new Vector2I(Width, Height); 57 52 58 53 /// <summary>Gets the y-coordinate of the top edge of this <see cref="T:System.Drawing.RectangleI"></see> structure.</summary> 59 54 /// <returns>The y-coordinate of the top edge of this <see cref="T:System.Drawing.RectangleI"></see> structure.</returns> ··· 105 100 { 106 101 if (!(obj is RectangleI)) 107 102 return false; 103 + 108 104 RectangleI ef = (RectangleI)obj; 109 105 return ef.X == X && ef.Y == Y && ef.Width == Width && ef.Height == Height; 110 106 } ··· 147 143 /// <summary>Gets the hash code for this <see cref="T:System.Drawing.RectangleI"></see> structure. For information about the use of hash codes, see Object.GetHashCode.</summary> 148 144 /// <returns>The hash code for this <see cref="T:System.Drawing.RectangleI"></see>.</returns> 149 145 /// <filterpriority>1</filterpriority> 150 - public override int GetHashCode() 151 - { 152 - // ReSharper disable NonReadonlyMemberInGetHashCode 153 - return 154 - (int)((uint)X ^ (uint)Y << 13 | (uint)Y >> 0x13 ^ 155 - (uint)Width << 0x1a | (uint)Width >> 6 ^ 156 - (uint)Height << 7 | (uint)Height >> 0x19); 157 - // ReSharper restore NonReadonlyMemberInGetHashCode 158 - } 146 + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] 147 + public override int GetHashCode() => (int)(((uint)X ^ ((uint)Y << 13)) | (((uint)Y >> 0x13) ^ ((uint)Width << 0x1a)) | (((uint)Width >> 6) ^ ((uint)Height << 7)) | ((uint)Height >> 0x19)); 159 148 160 149 public int Area => Width * Height; 161 150 ··· 223 212 int num4 = Math.Min(a.Y + a.Height, b.Y + b.Height); 224 213 if (num2 >= x && num4 >= y) 225 214 return new RectangleI(x, y, num2 - x, num4 - y); 215 + 226 216 return Empty; 227 217 } 228 218 ··· 261 251 /// <filterpriority>1</filterpriority> 262 252 /// <PermissionSet><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" /></PermissionSet> 263 253 public override string ToString() => $"X={X.ToString(CultureInfo.CurrentCulture)}, " 264 - + $"Y={Y.ToString(CultureInfo.CurrentCulture)}, " 265 - + $"Width={Width.ToString(CultureInfo.CurrentCulture)}, " 266 - + $"Height={Height.ToString(CultureInfo.CurrentCulture)}"; 254 + + $"Y={Y.ToString(CultureInfo.CurrentCulture)}, " 255 + + $"Width={Width.ToString(CultureInfo.CurrentCulture)}, " 256 + + $"Height={Height.ToString(CultureInfo.CurrentCulture)}"; 267 257 268 258 public bool Equals(RectangleI other) => X == other.X && Y == other.Y && Width == other.Width && Height == other.Height; 269 259 }
+6 -7
osu.Framework/Graphics/Primitives/Vector2I.cs
··· 3 3 4 4 using osuTK; 5 5 using System; 6 + using System.Diagnostics.CodeAnalysis; 6 7 using System.Runtime.InteropServices; 7 8 8 9 namespace osu.Framework.Graphics.Primitives ··· 13 14 public int X; 14 15 public int Y; 15 16 16 - public Vector2I(int val) : this(val, val) 17 + public Vector2I(int val) 18 + : this(val, val) 17 19 { 18 20 } 19 21 ··· 43 45 { 44 46 if (!(obj is Vector2I)) 45 47 return false; 48 + 46 49 return Equals((Vector2I)obj); 47 50 } 48 51 49 - public override int GetHashCode() 50 - { 51 - // ReSharper disable NonReadonlyMemberInGetHashCode 52 - return (int)((uint)X ^ (uint)Y << 13 | (uint)Y >> 0x13); 53 - // ReSharper restore NonReadonlyMemberInGetHashCode 54 - } 52 + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] 53 + public override int GetHashCode() => (int)(((uint)X ^ ((uint)Y << 13)) | ((uint)Y >> 0x13)); 55 54 } 56 55 }
+2 -4
osu.Framework/Graphics/Shaders/Shader.cs
··· 90 90 int location = GL.GetUniformLocation(this, name); 91 91 92 92 if (GlobalPropertyManager.CheckGlobalExists(name)) return new GlobalUniform<T>(this, name, location); 93 + 93 94 return new Uniform<T>(this, name, location); 94 95 } 95 96 ··· 178 179 return (Uniform<T>)Uniforms[name]; 179 180 } 180 181 181 - public static implicit operator int(Shader shader) 182 - { 183 - return shader.programID; 184 - } 182 + public static implicit operator int(Shader shader) => shader.programID; 185 183 186 184 #region Disposal 187 185
+1
osu.Framework/Graphics/Shaders/ShaderManager.cs
··· 45 45 name = shader_prefix + name; 46 46 if (name.EndsWith(ending, StringComparison.Ordinal)) 47 47 return name; 48 + 48 49 return name + ending; 49 50 } 50 51
+2 -4
osu.Framework/Graphics/Sprites/FontUsage.cs
··· 99 99 100 100 public override string ToString() => $"Font={FontName}, Size={Size}, Italics={Italics}, FixedWidth={FixedWidth}"; 101 101 102 - public bool Equals(FontUsage other) 103 - { 104 - return string.Equals(Family, other.Family) && string.Equals(Weight, other.Weight) && Italics == other.Italics && Size.Equals(other.Size) && FixedWidth == other.FixedWidth; 105 - } 102 + public bool Equals(FontUsage other) => string.Equals(Family, other.Family) && string.Equals(Weight, other.Weight) && Italics == other.Italics && Size.Equals(other.Size) && FixedWidth == other.FixedWidth; 106 103 107 104 public override bool Equals(object obj) 108 105 { 109 106 if (ReferenceEquals(null, obj)) return false; 107 + 110 108 return obj is FontUsage other && Equals(other); 111 109 } 112 110
+2 -4
osu.Framework/Graphics/Sprites/IconUsage.cs
··· 70 70 71 71 public override string ToString() => $"Icon={Icon} Font={FontName}"; 72 72 73 - public bool Equals(IconUsage other) 74 - { 75 - return Equals(Icon, other.Icon) && string.Equals(Family, other.Family) && string.Equals(Weight, other.Weight); 76 - } 73 + public bool Equals(IconUsage other) => Equals(Icon, other.Icon) && string.Equals(Family, other.Family) && string.Equals(Weight, other.Weight); 77 74 78 75 public override bool Equals(object obj) 79 76 { 80 77 if (ReferenceEquals(null, obj)) return false; 78 + 81 79 return obj is IconUsage other && Equals(other); 82 80 } 83 81
+7 -4
osu.Framework/Graphics/Sprites/SpriteText.cs
··· 85 85 { 86 86 if (text == value) 87 87 return; 88 + 88 89 text = value; 89 90 90 91 current.Value = text; ··· 172 173 { 173 174 if (allowMultiline == value) 174 175 return; 176 + 175 177 allowMultiline = value; 176 178 177 179 invalidate(true); ··· 190 192 { 191 193 if (shadow == value) 192 194 return; 195 + 193 196 shadow = value; 194 197 195 198 Invalidate(Invalidation.DrawNode); ··· 208 211 { 209 212 if (shadowColour == value) 210 213 return; 214 + 211 215 shadowColour = value; 212 216 213 217 Invalidate(Invalidation.DrawNode); ··· 227 231 { 228 232 if (useFullGlyphHeight == value) 229 233 return; 234 + 230 235 useFullGlyphHeight = value; 231 236 232 237 invalidate(true); ··· 317 322 { 318 323 if (spacing == value) 319 324 return; 325 + 320 326 spacing = value; 321 327 322 328 invalidate(true); ··· 614 620 return true; 615 621 } 616 622 617 - public override string ToString() 618 - { 619 - return $@"""{displayedText}"" " + base.ToString(); 620 - } 623 + public override string ToString() => $@"""{displayedText}"" " + base.ToString(); 621 624 622 625 /// <summary> 623 626 /// Gets the base height of the font used by this text. If the font of this text is invalid, 0 is returned.
+1 -4
osu.Framework/Graphics/Textures/PrefixTextureStore.cs
··· 15 15 this.prefix = prefix; 16 16 } 17 17 18 - public override Texture Get(string name) 19 - { 20 - return base.Get($@"{prefix}-{name}"); 21 - } 18 + public override Texture Get(string name) => base.Get($@"{prefix}-{name}"); 22 19 } 23 20 }
+1 -4
osu.Framework/Graphics/Textures/Texture.cs
··· 110 110 return texRect; 111 111 } 112 112 113 - public RectangleF GetTextureRect(RectangleF? textureRect = null) 114 - { 115 - return TextureGL.GetTextureRect(TextureBounds(textureRect)); 116 - } 113 + public RectangleF GetTextureRect(RectangleF? textureRect = null) => TextureGL.GetTextureRect(TextureBounds(textureRect)); 117 114 118 115 public void DrawTriangle(Triangle vertexTriangle, ColourInfo colour, RectangleF? textureRect = null, Action<TexturedVertex2D> vertexAction = null, Vector2? inflationPercentage = null) 119 116 {
+2
osu.Framework/Graphics/Textures/TextureWithRefCount.cs
··· 26 26 var tex = base.TextureGL; 27 27 if (tex.ReferenceCount <= 0) 28 28 throw new InvalidOperationException($"Attempting to access a {nameof(TextureWithRefCount)}'s underlying texture after all references are lost."); 29 + 29 30 return tex; 30 31 } 31 32 } ··· 48 49 49 50 if (isDisposed) 50 51 return; 52 + 51 53 isDisposed = true; 52 54 53 55 base.TextureGL.Dereference();
+2 -4
osu.Framework/Graphics/TransformableExtensions.cs
··· 125 125 /// </summary> 126 126 /// <returns>A <see cref="TransformSequence{T}"/> which has a delay waiting for all transforms to be completed.</returns> 127 127 public static TransformSequence<T> DelayUntilTransformsFinished<T>(this T transformable) 128 - where T : Transformable 129 - { 130 - return transformable.Delay(Math.Max(0, transformable.LatestTransformEndTime - transformable.Time.Current)); 131 - } 128 + where T : Transformable => 129 + transformable.Delay(Math.Max(0, transformable.LatestTransformEndTime - transformable.Time.Current)); 132 130 133 131 /// <summary> 134 132 /// Append a looping <see cref="TransformSequence{T}"/> to this <see cref="TransformSequence{T}"/>.
+4 -1
osu.Framework/Graphics/Transforms/TransformCustom.cs
··· 19 19 internal class TransformCustom<TValue, T> : Transform<TValue, T> where T : ITransformable 20 20 { 21 21 private delegate TValue ReadFunc(T transformable); 22 + 22 23 private delegate void WriteFunc(T transformable, TValue value); 23 24 24 25 private struct Accessor ··· 59 60 private static ReadFunc createPropertyGetter(MethodInfo getter) 60 61 { 61 62 if (!RuntimeInfo.SupportsJIT) return transformable => (TValue)getter.Invoke(transformable, new object[0]); 63 + 62 64 return (ReadFunc)getter.CreateDelegate(typeof(ReadFunc)); 63 65 } 64 66 65 67 private static WriteFunc createPropertySetter(MethodInfo setter) 66 68 { 67 - if (!RuntimeInfo.SupportsJIT) return (transformable, value) => setter.Invoke(transformable, new object[]{ value }); 69 + if (!RuntimeInfo.SupportsJIT) return (transformable, value) => setter.Invoke(transformable, new object[] { value }); 70 + 68 71 return (WriteFunc)setter.CreateDelegate(typeof(WriteFunc)); 69 72 } 70 73
+1
osu.Framework/Graphics/Transforms/Transformable.cs
··· 300 300 public virtual void ApplyTransformsAt(double time, bool propagateChildren = false) 301 301 { 302 302 if (RemoveCompletedTransforms) throw new InvalidOperationException($"Cannot arbitrarily apply transforms with {nameof(RemoveCompletedTransforms)} active."); 303 + 303 304 updateTransforms(time); 304 305 } 305 306
+5 -1
osu.Framework/Graphics/UserInterface/Counter.cs
··· 12 12 public class Counter : CompositeDrawable 13 13 { 14 14 private double count; 15 + 15 16 /// <summary> 16 17 /// The current count. 17 18 /// </summary> ··· 22 23 { 23 24 if (count == value) 24 25 return; 26 + 25 27 count = value; 26 28 27 29 OnCountChanged(count); ··· 31 33 /// <summary> 32 34 /// Invoked when <see cref="Count"/> has changed. 33 35 /// </summary> 34 - protected virtual void OnCountChanged(double count) { } 36 + protected virtual void OnCountChanged(double count) 37 + { 38 + } 35 39 36 40 public TransformSequence<Counter> CountTo(double endCount, double duration = 0, Easing easing = Easing.None) 37 41 => this.TransformTo(nameof(Count), endCount, duration, easing);
+5
osu.Framework/Graphics/UserInterface/Dropdown.cs
··· 45 45 { 46 46 if (usingItemSource) 47 47 throw new InvalidOperationException($"Cannot manually set {nameof(Items)} when an {nameof(ItemSource)} is bound."); 48 + 48 49 setItems(value); 49 50 } 50 51 } ··· 101 102 { 102 103 if (usingItemSource) 103 104 throw new InvalidOperationException($"Cannot manually add dropdown items when an {nameof(ItemSource)} is bound."); 105 + 104 106 addDropdownItem(text, value); 105 107 } 106 108 ··· 129 131 { 130 132 if (usingItemSource) 131 133 throw new InvalidOperationException($"Cannot manually remove items when an {nameof(ItemSource)} is bound."); 134 + 132 135 return removeDropdownItem(value); 133 136 } 134 137 ··· 240 243 { 241 244 if (usingItemSource) 242 245 throw new InvalidOperationException($"Cannot manually clear items when an {nameof(ItemSource)} is bound."); 246 + 243 247 clearItems(); 244 248 } 245 249 ··· 340 344 { 341 345 if (selected == value) 342 346 return; 347 + 343 348 selected = value; 344 349 345 350 OnSelectChange();
+15
osu.Framework/Graphics/UserInterface/Menu.cs
··· 161 161 } 162 162 163 163 private float maxWidth = float.MaxValue; 164 + 164 165 /// <summary> 165 166 /// Gets or sets the maximum allowable width by this <see cref="Menu"/>. 166 167 /// </summary> ··· 171 172 { 172 173 if (Precision.AlmostEquals(maxWidth, value)) 173 174 return; 175 + 174 176 maxWidth = value; 175 177 176 178 sizeCache.Invalidate(); ··· 178 180 } 179 181 180 182 private float maxHeight = float.PositiveInfinity; 183 + 181 184 /// <summary> 182 185 /// Gets or sets the maximum allowable height by this <see cref="Menu"/>. 183 186 /// </summary> ··· 188 191 { 189 192 if (Precision.AlmostEquals(maxHeight, value)) 190 193 return; 194 + 191 195 maxHeight = value; 192 196 193 197 sizeCache.Invalidate(); ··· 195 199 } 196 200 197 201 private MenuState state = MenuState.Closed; 202 + 198 203 /// <summary> 199 204 /// Gets or sets the current state of this <see cref="Menu"/>. 200 205 /// </summary> ··· 211 216 212 217 if (state == value) 213 218 return; 219 + 214 220 state = value; 215 221 216 222 updateState(); ··· 373 379 protected virtual void UpdateSize(Vector2 newSize) => Size = newSize; 374 380 375 381 #region Hover/Focus logic 382 + 376 383 private void menuItemClicked(DrawableMenuItem item) 377 384 { 378 385 // We only want to close the sub-menu if we're not a sub menu - if we are a sub menu ··· 446 453 } 447 454 448 455 private ScheduledDelegate openDelegate; 456 + 449 457 private void menuItemHovered(DrawableMenuItem item) 450 458 { 451 459 // If we're not a sub-menu, then hover shouldn't display a sub-menu unless an item is clicked ··· 534 542 protected virtual DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableMenuItem(item); 535 543 536 544 #region DrawableMenuItem 545 + 537 546 // must be public due to mono bug(?) https://github.com/ppy/osu/issues/1204 538 547 public class DrawableMenuItem : CompositeDrawable, IStateful<MenuItemState> 539 548 { ··· 606 615 } 607 616 608 617 private Color4 backgroundColour = Color4.DarkSlateGray; 618 + 609 619 /// <summary> 610 620 /// Gets or sets the default background colour. 611 621 /// </summary> ··· 620 630 } 621 631 622 632 private Color4 foregroundColour = Color4.White; 633 + 623 634 /// <summary> 624 635 /// Gets or sets the default foreground colour. 625 636 /// </summary> ··· 634 645 } 635 646 636 647 private Color4 backgroundColourHover = Color4.DarkGray; 648 + 637 649 /// <summary> 638 650 /// Gets or sets the background colour when this <see cref="DrawableMenuItem"/> is hovered. 639 651 /// </summary> ··· 648 660 } 649 661 650 662 private Color4 foregroundColourHover = Color4.White; 663 + 651 664 /// <summary> 652 665 /// Gets or sets the foreground colour when this <see cref="DrawableMenuItem"/> is hovered. 653 666 /// </summary> ··· 662 675 } 663 676 664 677 private MenuItemState state; 678 + 665 679 public MenuItemState State 666 680 { 667 681 get => state; ··· 763 777 Font = new FontUsage(size: 17), 764 778 }; 765 779 } 780 + 766 781 #endregion 767 782 } 768 783
+1
osu.Framework/Graphics/UserInterface/SliderBar.cs
··· 172 172 { 173 173 if (e.Key == Key.Left || e.Key == Key.Right) 174 174 return commit(); 175 + 175 176 return false; 176 177 } 177 178
+8 -2
osu.Framework/Graphics/UserInterface/TabControl.cs
··· 41 41 /// <summary> 42 42 /// A list of items currently in the tab control in the order they are dispalyed. 43 43 /// </summary> 44 - public IEnumerable<T> Items { 45 - get { 44 + public IEnumerable<T> Items 45 + { 46 + get 47 + { 46 48 var items = TabContainer.TabItems.Select(t => t.Value); 47 49 48 50 if (Dropdown != null) ··· 158 160 { 159 161 if (!tabMap.TryGetValue(item, out TabItem<T> tab)) 160 162 return; 163 + 161 164 tab.Pinned = true; 162 165 } 163 166 ··· 169 172 { 170 173 if (!tabMap.TryGetValue(item, out TabItem<T> tab)) 171 174 return; 175 + 172 176 tab.Pinned = false; 173 177 } 174 178 ··· 336 340 return true; 337 341 } 338 342 } 343 + 339 344 return false; 340 345 } 341 346 ··· 373 378 updateChildIfNeeded(child, result[i].Y == 0); 374 379 ++i; 375 380 } 381 + 376 382 return result; 377 383 } 378 384
+2
osu.Framework/Graphics/UserInterface/TextBox.cs
··· 278 278 { 279 279 if (index < text.Length) 280 280 return TextFlow.Children[index].DrawPosition.X + TextFlow.DrawPosition.X; 281 + 281 282 var d = TextFlow.Children[index - 1]; 282 283 return d.DrawPosition.X + d.DrawSize.X + TextFlow.Spacing.X + TextFlow.DrawPosition.X; 283 284 } ··· 294 295 { 295 296 if (d.DrawPosition.X + d.DrawSize.X / 2 > pos.X) 296 297 break; 298 + 297 299 i++; 298 300 } 299 301
+1
osu.Framework/Graphics/Video/VideoDecoder.cs
··· 369 369 { 370 370 if (cancellationToken.IsCancellationRequested) 371 371 return; 372 + 372 373 if (decoderCommands.TryDequeue(out var cmd)) 373 374 cmd(); 374 375 }
+1
osu.Framework/Graphics/Video/VideoSprite.cs
··· 52 52 return 0; 53 53 54 54 if (Loop) return (Clock.CurrentTime - startTime.Value) % Duration; 55 + 55 56 return Math.Min(Clock.CurrentTime - startTime.Value, Duration); 56 57 } 57 58 }
+1
osu.Framework/Graphics/Visualisation/InfoOverlay.cs
··· 18 18 set 19 19 { 20 20 if (target == value) return; 21 + 21 22 target = value; 22 23 23 24 foreach (FlashyBox c in Children)
+1
osu.Framework/Graphics/Visualisation/TreeContainer.cs
··· 44 44 { 45 45 if (state == value) 46 46 return; 47 + 47 48 state = value; 48 49 49 50 switch (state)
+6 -72
osu.Framework/IO/File/FileSafety.cs
··· 82 82 return false; 83 83 } 84 84 } 85 + 85 86 return true; 86 87 } 87 88 88 89 /// <summary> 89 90 /// Converts all slashes and backslashes to OS-specific directory separator characters. Useful for sanitising user input. 90 91 /// </summary> 91 - public static string PathSanitise(string path) 92 - { 93 - return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar); 94 - } 92 + public static string PathSanitise(string path) => path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar); 95 93 96 94 /// <summary> 97 95 /// Converts all OS-specific directory separator characters to '/'. Useful for outputting to a config file or similar. 98 96 /// </summary> 99 - public static string PathStandardise(string path) 100 - { 101 - return path.Replace('\\', '/'); 102 - } 97 + public static string PathStandardise(string path) => path.Replace('\\', '/'); 103 98 104 99 [Flags] 105 100 internal enum MoveFileFlags ··· 263 258 catch 264 259 { 265 260 } 261 + 266 262 System.IO.File.Delete(file); 267 263 } 268 264 } ··· 272 268 273 269 public static string GetExtension(string filename) => Path.GetExtension(filename)?.Trim('.').ToLower(); 274 270 275 - // public static FileType GetFileType(string filename) 276 - // { 277 - // try 278 - // { 279 - // string ext = GetExtension(filename); 280 - 281 - // switch (ext) 282 - // { 283 - // case "osu": 284 - // return FileType.Beatmap; 285 - // case "rar": 286 - // return FileType.BeatmapPack; 287 - // case "osz": 288 - // return FileType.BeatmapPackage; 289 - // case "osz2": 290 - // return FileType.BeatmapPackage2; 291 - // case "db": 292 - // return FileType.Database; 293 - // case "zip": 294 - // return FileType.Zip; 295 - //#if P2P 296 - // case "osumagnet": 297 - // return FileType.OsuMagnet; 298 - //#endif 299 - // case "osc": 300 - // return FileType.OsuM; //osu!stream 301 - // case "ogg": 302 - // case "mp3": 303 - // return FileType.AudioTrack; 304 - // case "osr": 305 - // return FileType.Replay; 306 - // case "osk": 307 - // return FileType.Skin; 308 - // case "osb": 309 - // return FileType.Storyboard; 310 - // case "avi": 311 - // case "flv": 312 - // case "mpg": 313 - // case "wmv": 314 - // case "m4v": 315 - // case "mp4": 316 - // return FileType.Video; 317 - // case "jpg": 318 - // case "jpeg": 319 - // case "png": 320 - // return FileType.Image; 321 - // case "wav": 322 - // return FileType.AudioSample; 323 - // case "exe": 324 - // return FileType.Exe; 325 - // default: 326 - // return FileType.Unknown; 327 - // } 328 - // } 329 - // catch 330 - // { 331 - // return FileType.Unknown; 332 - // } 333 - // } 334 - 335 271 public static int GetMaxPathLength(string directory) 336 272 { 337 273 int highestPathLength = directory.Length; ··· 352 288 return highestPathLength; 353 289 } 354 290 355 - public static string CleanStoryboardFilename(string filename) 356 - { 357 - return PathStandardise(filename.Trim('"')); 358 - } 291 + public static string CleanStoryboardFilename(string filename) => PathStandardise(filename.Trim('"')); 359 292 360 293 //This is better than encoding as it doesn't check for origin specific data or remove invalid chars. 361 294 public static unsafe string RawBytesToString(byte[] encoded) ··· 376 309 stringBytes++; 377 310 } while (stringBytes != stringEnd); 378 311 } 312 + 379 313 return new string(converted); 380 314 } 381 315
+2 -4
osu.Framework/IO/Network/WebRequest.cs
··· 629 629 protected void Dispose(bool disposing) 630 630 { 631 631 if (isDisposed) return; 632 + 632 633 isDisposed = true; 633 634 634 635 Abort(); ··· 671 672 return read; 672 673 } 673 674 674 - public override long Seek(long offset, SeekOrigin origin) 675 - { 676 - return baseStream.Seek(offset, origin); 677 - } 675 + public override long Seek(long offset, SeekOrigin origin) => baseStream.Seek(offset, origin); 678 676 679 677 public override void SetLength(long value) 680 678 {
+1
osu.Framework/IO/Stores/FileSystemResourceStore.cs
··· 37 37 { 38 38 if (isDisposed) 39 39 return; 40 + 40 41 isDisposed = true; 41 42 42 43 watcher.Dispose();
+1 -4
osu.Framework/IO/Stores/GlyphStore.cs
··· 137 137 return t; 138 138 } 139 139 140 - public Stream GetStream(string name) 141 - { 142 - throw new NotSupportedException(); 143 - } 140 + public Stream GetStream(string name) => throw new NotSupportedException(); 144 141 145 142 private int loadedPageCount; 146 143 private int loadedGlyphCount;
+2
osu.Framework/Input/Bindings/KeyBindingContainer.cs
··· 113 113 case KeyDownEvent keyDown: 114 114 if (keyDown.Repeat && !SendRepeats) 115 115 return pressedBindings.Count > 0; 116 + 116 117 return handleNewPressed(state, KeyCombination.FromKey(keyDown.Key), keyDown.Repeat); 117 118 118 119 case KeyUpEvent keyUp: ··· 128 129 { 129 130 var key = KeyCombination.FromScrollDelta(scroll.ScrollDelta); 130 131 if (key == InputKey.None) return false; 132 + 131 133 return handleNewPressed(state, key, false, scroll.ScrollDelta, scroll.IsPrecise) | handleNewReleased(state, key); 132 134 } 133 135 }
+6 -1
osu.Framework/Input/Bindings/KeyCombination.cs
··· 26 26 /// <param name="keys">The keys.</param> 27 27 public KeyCombination(IEnumerable<InputKey> keys) 28 28 { 29 - Keys = keys?.Any() == true ? keys.OrderBy(k => (int)k).ToArray() : new [] { InputKey.None }; 29 + Keys = keys?.Any() == true ? keys.OrderBy(k => (int)k).ToArray() : new[] { InputKey.None }; 30 30 } 31 31 32 32 /// <summary> ··· 57 57 case KeyCombinationMatchingMode.Modifiers: 58 58 if (Keys.Except(pressedKeys.Keys).Any()) 59 59 return false; 60 + 60 61 var pressedModifiers = pressedKeys.Keys.Where(IsModifierKey); 61 62 var requiredModifiers = Keys.Where(IsModifierKey); 62 63 return pressedModifiers.Count() == requiredModifiers.Count() && pressedModifiers.All(requiredModifiers.Contains); ··· 70 71 { 71 72 if (ReferenceEquals(null, other)) return false; 72 73 if (ReferenceEquals(this, other)) return true; 74 + 73 75 return Keys.SequenceEqual(other.Keys); 74 76 } 75 77 ··· 78 80 if (ReferenceEquals(null, obj)) return false; 79 81 if (ReferenceEquals(this, obj)) return true; 80 82 if (obj.GetType() != GetType()) return false; 83 + 81 84 return Equals((KeyCombination)obj); 82 85 } 83 86 ··· 257 260 return InputKey.FirstJoystickAxisPositiveButton + (button - JoystickButton.FirstAxisPositive); 258 261 if (button >= JoystickButton.FirstAxisNegative) 259 262 return InputKey.FirstJoystickAxisNegativeButton + (button - JoystickButton.FirstAxisNegative); 263 + 260 264 return InputKey.FirstJoystickButton + (button - JoystickButton.FirstButton); 261 265 } 262 266 ··· 264 268 { 265 269 if (scrollDelta.Y > 0) return InputKey.MouseWheelUp; 266 270 if (scrollDelta.Y < 0) return InputKey.MouseWheelDown; 271 + 267 272 return InputKey.None; 268 273 } 269 274
+1
osu.Framework/Input/Handlers/Keyboard/OsuTKKeyboardHandler.cs
··· 47 47 48 48 if (lastRawState != null && rawState.Equals(lastRawState)) 49 49 return; 50 + 50 51 lastRawState = rawState; 51 52 52 53 var newState = new TkKeyboardState(rawState);
+11 -31
osu.Framework/Input/InputManager.cs
··· 376 376 hoverEventsUpdated = true; 377 377 } 378 378 379 - private bool isModifierKey(Key k) 380 - { 381 - return k == Key.LControl || k == Key.RControl 382 - || k == Key.LAlt || k == Key.RAlt 383 - || k == Key.LShift || k == Key.RShift 384 - || k == Key.LWin || k == Key.RWin; 385 - } 379 + private bool isModifierKey(Key k) => 380 + k == Key.LControl || k == Key.RControl 381 + || k == Key.LAlt || k == Key.RAlt 382 + || k == Key.LShift || k == Key.RShift 383 + || k == Key.LWin || k == Key.RWin; 386 384 387 385 protected virtual void HandleKeyboardKeyStateChange(ButtonStateChangeEvent<Key> keyboardKeyStateChange) 388 386 { ··· 475 473 manager.HandleButtonStateChange(e.State, e.Kind, Time.Current); 476 474 } 477 475 478 - private bool handleMouseMove(InputState state, Vector2 lastPosition) 479 - { 480 - return PropagateBlockableEvent(PositionalInputQueue, new MouseMoveEvent(state, lastPosition)); 481 - } 476 + private bool handleMouseMove(InputState state, Vector2 lastPosition) => PropagateBlockableEvent(PositionalInputQueue, new MouseMoveEvent(state, lastPosition)); 482 477 483 - private bool handleScroll(InputState state, Vector2 lastScroll, bool isPrecise) 484 - { 485 - return PropagateBlockableEvent(PositionalInputQueue, new ScrollEvent(state, state.Mouse.Scroll - lastScroll, isPrecise)); 486 - } 478 + private bool handleScroll(InputState state, Vector2 lastScroll, bool isPrecise) => PropagateBlockableEvent(PositionalInputQueue, new ScrollEvent(state, state.Mouse.Scroll - lastScroll, isPrecise)); 487 479 488 - private bool handleKeyDown(InputState state, Key key, bool repeat) 489 - { 490 - return PropagateBlockableEvent(NonPositionalInputQueue, new KeyDownEvent(state, key, repeat)); 491 - } 480 + private bool handleKeyDown(InputState state, Key key, bool repeat) => PropagateBlockableEvent(NonPositionalInputQueue, new KeyDownEvent(state, key, repeat)); 492 481 493 - private bool handleKeyUp(InputState state, Key key) 494 - { 495 - return PropagateBlockableEvent(NonPositionalInputQueue, new KeyUpEvent(state, key)); 496 - } 482 + private bool handleKeyUp(InputState state, Key key) => PropagateBlockableEvent(NonPositionalInputQueue, new KeyUpEvent(state, key)); 497 483 498 - private bool handleJoystickPress(InputState state, JoystickButton button) 499 - { 500 - return PropagateBlockableEvent(NonPositionalInputQueue, new JoystickPressEvent(state, button)); 501 - } 484 + private bool handleJoystickPress(InputState state, JoystickButton button) => PropagateBlockableEvent(NonPositionalInputQueue, new JoystickPressEvent(state, button)); 502 485 503 - private bool handleJoystickRelease(InputState state, JoystickButton button) 504 - { 505 - return PropagateBlockableEvent(NonPositionalInputQueue, new JoystickReleaseEvent(state, button)); 506 - } 486 + private bool handleJoystickRelease(InputState state, JoystickButton button) => PropagateBlockableEvent(NonPositionalInputQueue, new JoystickReleaseEvent(state, button)); 507 487 508 488 /// <summary> 509 489 /// Triggers events on drawables in <paramref cref="drawables"/> until it is handled.
+1
osu.Framework/Input/InputResampler.cs
··· 64 64 float realMovementDistance = realDiff.Length; 65 65 if (realMovementDistance < 1) 66 66 return Array.Empty<Vector2>(); 67 + 67 68 lastActualPosition = position; 68 69 69 70 // don't update when it moved less than 10 pixels from the last position in a straight fashion
+1
osu.Framework/Input/PassThroughInputManager.cs
··· 34 34 set 35 35 { 36 36 if (useParentInput == value) return; 37 + 37 38 useParentInput = value; 38 39 39 40 if (UseParentInput)
+1 -4
osu.Framework/Input/StateChanges/ButtonInput.cs
··· 60 60 /// <param name="state">The <see cref="InputState"/> which changed.</param> 61 61 /// <param name="button">The <see cref="TButton"/> that changed.</param> 62 62 /// <param name="kind">The type of change that occurred on <paramref name="button"/>.</param> 63 - protected virtual ButtonStateChangeEvent<TButton> CreateEvent(InputState state, TButton button, ButtonStateChangeKind kind) 64 - { 65 - return new ButtonStateChangeEvent<TButton>(state, this, button, kind); 66 - } 63 + protected virtual ButtonStateChangeEvent<TButton> CreateEvent(InputState state, TButton button, ButtonStateChangeKind kind) => new ButtonStateChangeEvent<TButton>(state, this, button, kind); 67 64 68 65 public void Apply(InputState state, IInputStateChangeHandler handler) 69 66 {
+2 -8
osu.Framework/Input/States/ButtonStates.cs
··· 55 55 /// Enumerates the differences between ourselves and a previous <see cref="ButtonStates{TButton}"/>. 56 56 /// </summary> 57 57 /// <param name="lastButtons">The previous <see cref="ButtonStates{TButton}"/>.</param> 58 - public ButtonStateDifference EnumerateDifference(ButtonStates<TButton> lastButtons) 59 - { 60 - return new ButtonStateDifference(lastButtons.Except(this).ToArray(), this.Except(lastButtons).ToArray()); 61 - } 58 + public ButtonStateDifference EnumerateDifference(ButtonStates<TButton> lastButtons) => new ButtonStateDifference(lastButtons.Except(this).ToArray(), this.Except(lastButtons).ToArray()); 62 59 63 60 /// <summary> 64 61 /// Copies the state of another <see cref="ButtonStates{TButton}"/> to ourselves. ··· 70 67 pressedButtons.AddRange(other.pressedButtons); 71 68 } 72 69 73 - public override string ToString() 74 - { 75 - return $@"{GetType().ReadableName()}({String.Join(" ", pressedButtons)})"; 76 - } 70 + public override string ToString() => $@"{GetType().ReadableName()}({String.Join(" ", pressedButtons)})"; 77 71 78 72 public IEnumerator<TButton> GetEnumerator() => ((IEnumerable<TButton>)pressedButtons).GetEnumerator(); 79 73 IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+1
osu.Framework/Input/UserInputManager.cs
··· 38 38 case MouseScrollChangeEvent _: 39 39 if (Host.Window != null && !Host.Window.CursorInWindow) 40 40 return; 41 + 41 42 break; 42 43 } 43 44
+1
osu.Framework/Lists/SortedList.cs
··· 87 87 int index = IndexOf(item); 88 88 if (index < 0) 89 89 return false; 90 + 90 91 RemoveAt(index); 91 92 return true; 92 93 }
+1
osu.Framework/Localisation/LocalisationManager_LocalisedBindableString.cs
··· 55 55 { 56 56 if (text.Equals(value)) 57 57 return; 58 + 58 59 text = value; 59 60 60 61 updateValue();
+2 -6
osu.Framework/Logging/Logger.cs
··· 192 192 /// </summary> 193 193 /// <param name="target">The logging target.</param> 194 194 /// <returns>The logger responsible for the given logging target.</returns> 195 - public static Logger GetLogger(LoggingTarget target = LoggingTarget.Runtime) 196 - { 197 - // there can be no name conflicts between LoggingTarget-based Loggers and named loggers because 198 - // every name that would coincide with a LoggingTarget-value is reserved and cannot be used (see ctor). 199 - return GetLogger(target.ToString()); 200 - } 195 + public static Logger GetLogger(LoggingTarget target = LoggingTarget.Runtime) => GetLogger(target.ToString()); 201 196 202 197 /// <summary> 203 198 /// For classes that regularly log to the same target, this method may be preferred over the static Log method. ··· 387 382 private void ensureHeader() 388 383 { 389 384 if (headerAdded) return; 385 + 390 386 headerAdded = true; 391 387 392 388 add("----------------------------------------------------------", outputToListeners: false);
+14 -4
osu.Framework/MathUtils/Interpolation.cs
··· 81 81 w[i] *= points[i].X - points[j].X; 82 82 w[i] = 1.0 / w[i]; 83 83 } 84 + 84 85 return w; 85 86 } 86 87 ··· 128 129 }; 129 130 } 130 131 131 - public static EdgeEffectParameters ValueAt(double time, EdgeEffectParameters startParams, EdgeEffectParameters endParams, double startTime, double endTime, Easing easing = Easing.None) 132 - { 133 - return new EdgeEffectParameters 132 + public static EdgeEffectParameters ValueAt(double time, EdgeEffectParameters startParams, EdgeEffectParameters endParams, double startTime, double endTime, Easing easing = Easing.None) => 133 + new EdgeEffectParameters 134 134 { 135 135 Type = startParams.Type, 136 136 Hollow = startParams.Hollow, ··· 139 139 Radius = ValueAt(time, startParams.Radius, endParams.Radius, startTime, endTime, easing), 140 140 Roundness = ValueAt(time, startParams.Roundness, endParams.Roundness, startTime, endTime, easing), 141 141 }; 142 - } 143 142 144 143 public static SRGBColour ValueAt(double time, SRGBColour startColour, SRGBColour endColour, double startTime, double endTime, Easing easing = Easing.None) => 145 144 ValueAt(time, (Color4)startColour, (Color4)endColour, startTime, endTime, easing); ··· 263 262 return time * (2 - time); 264 263 case Easing.InOutQuad: 265 264 if (time < .5) return time * time * 2; 265 + 266 266 return --time * time * -2 + 1; 267 267 268 268 case Easing.InCubic: ··· 271 271 return --time * time * time + 1; 272 272 case Easing.InOutCubic: 273 273 if (time < .5) return time * time * time * 4; 274 + 274 275 return --time * time * time * 4 + 1; 275 276 276 277 case Easing.InQuart: ··· 279 280 return 1 - --time * time * time * time; 280 281 case Easing.InOutQuart: 281 282 if (time < .5) return time * time * time * time * 8; 283 + 282 284 return --time * time * time * time * -8 + 1; 283 285 284 286 case Easing.InQuint: ··· 287 289 return --time * time * time * time * time + 1; 288 290 case Easing.InOutQuint: 289 291 if (time < .5) return time * time * time * time * time * 16; 292 + 290 293 return --time * time * time * time * time * 16 + 1; 291 294 292 295 case Easing.InSine: ··· 302 305 return -Math.Pow(2, -10 * time) + 1; 303 306 case Easing.InOutExpo: 304 307 if (time < .5) return .5 * Math.Pow(2, 20 * time - 10); 308 + 305 309 return 1 - .5 * Math.Pow(2, -20 * time + 10); 306 310 307 311 case Easing.InCirc: ··· 310 314 return Math.Sqrt(1 - --time * time); 311 315 case Easing.InOutCirc: 312 316 if ((time *= 2) < 1) return .5 - .5 * Math.Sqrt(1 - time * time); 317 + 313 318 return .5 * Math.Sqrt(1 - (time -= 2) * time) + .5; 314 319 315 320 case Easing.InElastic: ··· 323 328 case Easing.InOutElastic: 324 329 if ((time *= 2) < 1) 325 330 return -.5 * Math.Pow(2, -10 + 10 * time) * Math.Sin((1 - elastic_const2 * 1.5 - time) * elastic_const / 1.5); 331 + 326 332 return .5 * Math.Pow(2, -10 * --time) * Math.Sin((time - elastic_const2 * 1.5) * elastic_const / 1.5) + 1; 327 333 328 334 case Easing.InBack: ··· 331 337 return --time * time * ((back_const + 1) * time + back_const) + 1; 332 338 case Easing.InOutBack: 333 339 if ((time *= 2) < 1) return .5 * time * time * ((back_const2 + 1) * time - back_const2); 340 + 334 341 return .5 * ((time -= 2) * time * ((back_const2 + 1) * time + back_const2) + 2); 335 342 336 343 case Easing.InBounce: ··· 341 348 return 1 - (7.5625 * (time -= 1.5 * bounce_const) * time + .75); 342 349 if (time < 2.5 * bounce_const) 343 350 return 1 - (7.5625 * (time -= 2.25 * bounce_const) * time + .9375); 351 + 344 352 return 1 - (7.5625 * (time -= 2.625 * bounce_const) * time + .984375); 345 353 case Easing.OutBounce: 346 354 if (time < bounce_const) ··· 349 357 return 7.5625 * (time -= 1.5 * bounce_const) * time + .75; 350 358 if (time < 2.5 * bounce_const) 351 359 return 7.5625 * (time -= 2.25 * bounce_const) * time + .9375; 360 + 352 361 return 7.5625 * (time -= 2.625 * bounce_const) * time + .984375; 353 362 case Easing.InOutBounce: 354 363 if (time < .5) return .5 - .5 * ApplyEasing(Easing.OutBounce, 1 - time * 2); 364 + 355 365 return ApplyEasing(Easing.OutBounce, (time - .5) * 2) * .5 + .5; 356 366 357 367 case Easing.OutPow10:
+7 -28
osu.Framework/MathUtils/Precision.cs
··· 11 11 public const float FLOAT_EPSILON = 1e-3f; 12 12 public const double DOUBLE_EPSILON = 1e-7; 13 13 14 - public static bool DefinitelyBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) 15 - { 16 - return value1 - acceptableDifference > value2; 17 - } 14 + public static bool DefinitelyBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => value1 - acceptableDifference > value2; 18 15 19 - public static bool DefinitelyBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) 20 - { 21 - return value1 - acceptableDifference > value2; 22 - } 16 + public static bool DefinitelyBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => value1 - acceptableDifference > value2; 23 17 24 - public static bool AlmostBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) 25 - { 26 - return value1 > value2 - acceptableDifference; 27 - } 18 + public static bool AlmostBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => value1 > value2 - acceptableDifference; 28 19 29 - public static bool AlmostBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) 30 - { 31 - return value1 > value2 - acceptableDifference; 32 - } 20 + public static bool AlmostBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => value1 > value2 - acceptableDifference; 33 21 34 - public static bool AlmostEquals(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) 35 - { 36 - return Math.Abs(value1 - value2) <= acceptableDifference; 37 - } 22 + public static bool AlmostEquals(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => Math.Abs(value1 - value2) <= acceptableDifference; 38 23 39 - public static bool AlmostEquals(Vector2 value1, Vector2 value2, float acceptableDifference = FLOAT_EPSILON) 40 - { 41 - return AlmostEquals(value1.X, value2.X, acceptableDifference) && AlmostEquals(value1.Y, value2.Y, acceptableDifference); 42 - } 24 + public static bool AlmostEquals(Vector2 value1, Vector2 value2, float acceptableDifference = FLOAT_EPSILON) => AlmostEquals(value1.X, value2.X, acceptableDifference) && AlmostEquals(value1.Y, value2.Y, acceptableDifference); 43 25 44 - public static bool AlmostEquals(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) 45 - { 46 - return Math.Abs(value1 - value2) <= acceptableDifference; 47 - } 26 + public static bool AlmostEquals(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => Math.Abs(value1 - value2) <= acceptableDifference; 48 27 } 49 28 }
+6 -5
osu.Framework/Platform/DesktopGameWindow.cs
··· 116 116 return; 117 117 118 118 var newResolution = display.AvailableResolutions 119 - .Where(r => r.Width == newSize.Width && r.Height == newSize.Height) 120 - .OrderByDescending(r => r.RefreshRate) 121 - .ThenByDescending(r => r.BitsPerPixel) 122 - .FirstOrDefault(); 119 + .Where(r => r.Width == newSize.Width && r.Height == newSize.Height) 120 + .OrderByDescending(r => r.RefreshRate) 121 + .ThenByDescending(r => r.BitsPerPixel) 122 + .FirstOrDefault(); 123 123 124 124 if (newResolution == null) 125 125 { ··· 150 150 protected void OnMove(object sender, EventArgs e) 151 151 { 152 152 if (inWindowModeTransition) return; 153 + 153 154 if (WindowMode.Value == Configuration.WindowMode.Windowed) 154 155 { 155 156 // Values are clamped to a range of [-0.5, 1.5], so if more than half of the window was ··· 264 265 var relativeLocation = new Point(Location.X - display.Bounds.X, Location.Y - display.Bounds.Y); 265 266 266 267 return new Vector2( 267 - display.Width > Size.Width ? (float)relativeLocation.X / (display.Width - Size.Width) : 0, 268 + display.Width > Size.Width ? (float)relativeLocation.X / (display.Width - Size.Width) : 0, 268 269 display.Height > Size.Height ? (float)relativeLocation.Y / (display.Height - Size.Height) : 0); 269 270 } 270 271 set
+4 -4
osu.Framework/Platform/GameHost.cs
··· 90 90 91 91 protected void OnMessageReceived(IpcMessage message) => MessageReceived?.Invoke(message); 92 92 93 - public virtual Task SendMessageAsync(IpcMessage message) 94 - { 95 - throw new NotSupportedException("This platform does not implement IPC."); 96 - } 93 + public virtual Task SendMessageAsync(IpcMessage message) => throw new NotSupportedException("This platform does not implement IPC."); 97 94 98 95 /// <summary> 99 96 /// Requests that a file be opened externally with an associated application, if available. ··· 636 633 { 637 634 if (!e.Control) 638 635 return; 636 + 639 637 switch (e.Key) 640 638 { 641 639 case Key.F7: ··· 670 668 { 671 669 if (Window == null) 672 670 return; 671 + 673 672 if (!Window.SupportedWindowModes.Contains(mode.NewValue)) 674 673 windowMode.Value = Window.DefaultWindowMode; 675 674 }, true); ··· 768 767 { 769 768 if (isDisposed) 770 769 return; 770 + 771 771 isDisposed = true; 772 772 773 773 if (ExecutionState > ExecutionState.Stopping)
+229 -38
osu.Framework/Platform/GameWindow.cs
··· 208 208 { 209 209 string result = version.Split(' ').FirstOrDefault(s => char.IsDigit(s, 0)); 210 210 if (result != null) return result; 211 + 211 212 throw new ArgumentException(nameof(version)); 212 213 } 213 214 ··· 260 261 public void MakeCurrent() => Implementation.MakeCurrent(); 261 262 public void SwapBuffers() => Implementation.SwapBuffers(); 262 263 263 - Icon INativeWindow.Icon { get => Implementation.Icon; set => Implementation.Icon = value; } 264 - public string Title { get => Implementation.Title; set => Implementation.Title = value; } 264 + Icon INativeWindow.Icon 265 + { 266 + get => Implementation.Icon; 267 + set => Implementation.Icon = value; 268 + } 269 + 270 + public string Title 271 + { 272 + get => Implementation.Title; 273 + set => Implementation.Title = value; 274 + } 275 + 265 276 public virtual bool Focused => Implementation.Focused; 266 - public bool Visible { get => Implementation.Visible; set => Implementation.Visible = value; } 277 + 278 + public bool Visible 279 + { 280 + get => Implementation.Visible; 281 + set => Implementation.Visible = value; 282 + } 283 + 267 284 public bool Exists => Implementation.Exists; 268 285 public IWindowInfo WindowInfo => Implementation.WindowInfo; 269 - public virtual WindowState WindowState { get => Implementation.WindowState; set => Implementation.WindowState = value; } 270 - public WindowBorder WindowBorder { get => Implementation.WindowBorder; set => Implementation.WindowBorder = value; } 271 - public Rectangle Bounds { get => Implementation.Bounds; set => Implementation.Bounds = value; } 272 - public Point Location { get => Implementation.Location; set => Implementation.Location = value; } 273 - public Size Size { get => Implementation.Size; set => Implementation.Size = value; } 274 - public int X { get => Implementation.X; set => Implementation.X = value; } 275 - public int Y { get => Implementation.Y; set => Implementation.Y = value; } 276 - public int Width { get => Implementation.Width; set => Implementation.Width = value; } 277 - public int Height { get => Implementation.Height; set => Implementation.Height = value; } 278 - public Rectangle ClientRectangle { get => Implementation.ClientRectangle; set => Implementation.ClientRectangle = value; } 279 - public Size ClientSize { get => Implementation.ClientSize; set => Implementation.ClientSize = value; } 286 + 287 + public virtual WindowState WindowState 288 + { 289 + get => Implementation.WindowState; 290 + set => Implementation.WindowState = value; 291 + } 292 + 293 + public WindowBorder WindowBorder 294 + { 295 + get => Implementation.WindowBorder; 296 + set => Implementation.WindowBorder = value; 297 + } 298 + 299 + public Rectangle Bounds 300 + { 301 + get => Implementation.Bounds; 302 + set => Implementation.Bounds = value; 303 + } 304 + 305 + public Point Location 306 + { 307 + get => Implementation.Location; 308 + set => Implementation.Location = value; 309 + } 310 + 311 + public Size Size 312 + { 313 + get => Implementation.Size; 314 + set => Implementation.Size = value; 315 + } 316 + 317 + public int X 318 + { 319 + get => Implementation.X; 320 + set => Implementation.X = value; 321 + } 322 + 323 + public int Y 324 + { 325 + get => Implementation.Y; 326 + set => Implementation.Y = value; 327 + } 328 + 329 + public int Width 330 + { 331 + get => Implementation.Width; 332 + set => Implementation.Width = value; 333 + } 334 + 335 + public int Height 336 + { 337 + get => Implementation.Height; 338 + set => Implementation.Height = value; 339 + } 340 + 341 + public Rectangle ClientRectangle 342 + { 343 + get => Implementation.ClientRectangle; 344 + set => Implementation.ClientRectangle = value; 345 + } 346 + 347 + public Size ClientSize 348 + { 349 + get => Implementation.ClientSize; 350 + set => Implementation.ClientSize = value; 351 + } 280 352 281 353 public void Close() => Implementation.Close(); 282 354 public void ProcessEvents() => Implementation.ProcessEvents(); ··· 284 356 public Point PointToScreen(Point point) => Implementation.PointToScreen(point); 285 357 public void Dispose() => Implementation.Dispose(); 286 358 287 - public event EventHandler<EventArgs> Load { add => Implementation.Load += value; remove => Implementation.Load -= value; } 288 - public event EventHandler<EventArgs> Unload { add => Implementation.Unload += value; remove => Implementation.Unload -= value; } 289 - public event EventHandler<FrameEventArgs> UpdateFrame { add => Implementation.UpdateFrame += value; remove => Implementation.UpdateFrame -= value; } 290 - public event EventHandler<FrameEventArgs> RenderFrame { add => Implementation.RenderFrame += value; remove => Implementation.RenderFrame -= value; } 291 - public event EventHandler<EventArgs> Move { add => Implementation.Move += value; remove => Implementation.Move -= value; } 292 - public event EventHandler<EventArgs> Resize { add => Implementation.Resize += value; remove => Implementation.Resize -= value; } 293 - public event EventHandler<CancelEventArgs> Closing { add => Implementation.Closing += value; remove => Implementation.Closing -= value; } 294 - public event EventHandler<EventArgs> Closed { add => Implementation.Closed += value; remove => Implementation.Closed -= value; } 295 - public event EventHandler<EventArgs> Disposed { add => Implementation.Disposed += value; remove => Implementation.Disposed -= value; } 296 - public event EventHandler<EventArgs> IconChanged { add => Implementation.IconChanged += value; remove => Implementation.IconChanged -= value; } 297 - public event EventHandler<EventArgs> TitleChanged { add => Implementation.TitleChanged += value; remove => Implementation.TitleChanged -= value; } 298 - public event EventHandler<EventArgs> VisibleChanged { add => Implementation.VisibleChanged += value; remove => Implementation.VisibleChanged -= value; } 299 - public event EventHandler<EventArgs> FocusedChanged { add => Implementation.FocusedChanged += value; remove => Implementation.FocusedChanged -= value; } 300 - public event EventHandler<EventArgs> WindowBorderChanged { add => Implementation.WindowBorderChanged += value; remove => Implementation.WindowBorderChanged -= value; } 301 - public event EventHandler<EventArgs> WindowStateChanged { add => Implementation.WindowStateChanged += value; remove => Implementation.WindowStateChanged -= value; } 302 - public event EventHandler<KeyPressEventArgs> KeyPress { add => Implementation.KeyPress += value; remove => Implementation.KeyPress -= value; } 303 - public event EventHandler<KeyboardKeyEventArgs> KeyUp { add => Implementation.KeyUp += value; remove => Implementation.KeyUp -= value; } 304 - public event EventHandler<EventArgs> MouseLeave { add => Implementation.MouseLeave += value; remove => Implementation.MouseLeave -= value; } 305 - public event EventHandler<EventArgs> MouseEnter { add => Implementation.MouseEnter += value; remove => Implementation.MouseEnter -= value; } 306 - public event EventHandler<MouseButtonEventArgs> MouseDown { add => Implementation.MouseDown += value; remove => Implementation.MouseDown -= value; } 307 - public event EventHandler<MouseButtonEventArgs> MouseUp { add => Implementation.MouseUp += value; remove => Implementation.MouseUp -= value; } 308 - public event EventHandler<MouseMoveEventArgs> MouseMove { add => Implementation.MouseMove += value; remove => Implementation.MouseMove -= value; } 309 - public event EventHandler<MouseWheelEventArgs> MouseWheel { add => Implementation.MouseWheel += value; remove => Implementation.MouseWheel -= value; } 310 - public event EventHandler<FileDropEventArgs> FileDrop { add => Implementation.FileDrop += value; remove => Implementation.FileDrop -= value; } 359 + public event EventHandler<EventArgs> Load 360 + { 361 + add => Implementation.Load += value; 362 + remove => Implementation.Load -= value; 363 + } 364 + 365 + public event EventHandler<EventArgs> Unload 366 + { 367 + add => Implementation.Unload += value; 368 + remove => Implementation.Unload -= value; 369 + } 370 + 371 + public event EventHandler<FrameEventArgs> UpdateFrame 372 + { 373 + add => Implementation.UpdateFrame += value; 374 + remove => Implementation.UpdateFrame -= value; 375 + } 376 + 377 + public event EventHandler<FrameEventArgs> RenderFrame 378 + { 379 + add => Implementation.RenderFrame += value; 380 + remove => Implementation.RenderFrame -= value; 381 + } 382 + 383 + public event EventHandler<EventArgs> Move 384 + { 385 + add => Implementation.Move += value; 386 + remove => Implementation.Move -= value; 387 + } 388 + 389 + public event EventHandler<EventArgs> Resize 390 + { 391 + add => Implementation.Resize += value; 392 + remove => Implementation.Resize -= value; 393 + } 394 + 395 + public event EventHandler<CancelEventArgs> Closing 396 + { 397 + add => Implementation.Closing += value; 398 + remove => Implementation.Closing -= value; 399 + } 400 + 401 + public event EventHandler<EventArgs> Closed 402 + { 403 + add => Implementation.Closed += value; 404 + remove => Implementation.Closed -= value; 405 + } 406 + 407 + public event EventHandler<EventArgs> Disposed 408 + { 409 + add => Implementation.Disposed += value; 410 + remove => Implementation.Disposed -= value; 411 + } 412 + 413 + public event EventHandler<EventArgs> IconChanged 414 + { 415 + add => Implementation.IconChanged += value; 416 + remove => Implementation.IconChanged -= value; 417 + } 418 + 419 + public event EventHandler<EventArgs> TitleChanged 420 + { 421 + add => Implementation.TitleChanged += value; 422 + remove => Implementation.TitleChanged -= value; 423 + } 424 + 425 + public event EventHandler<EventArgs> VisibleChanged 426 + { 427 + add => Implementation.VisibleChanged += value; 428 + remove => Implementation.VisibleChanged -= value; 429 + } 430 + 431 + public event EventHandler<EventArgs> FocusedChanged 432 + { 433 + add => Implementation.FocusedChanged += value; 434 + remove => Implementation.FocusedChanged -= value; 435 + } 436 + 437 + public event EventHandler<EventArgs> WindowBorderChanged 438 + { 439 + add => Implementation.WindowBorderChanged += value; 440 + remove => Implementation.WindowBorderChanged -= value; 441 + } 442 + 443 + public event EventHandler<EventArgs> WindowStateChanged 444 + { 445 + add => Implementation.WindowStateChanged += value; 446 + remove => Implementation.WindowStateChanged -= value; 447 + } 448 + 449 + public event EventHandler<KeyPressEventArgs> KeyPress 450 + { 451 + add => Implementation.KeyPress += value; 452 + remove => Implementation.KeyPress -= value; 453 + } 454 + 455 + public event EventHandler<KeyboardKeyEventArgs> KeyUp 456 + { 457 + add => Implementation.KeyUp += value; 458 + remove => Implementation.KeyUp -= value; 459 + } 460 + 461 + public event EventHandler<EventArgs> MouseLeave 462 + { 463 + add => Implementation.MouseLeave += value; 464 + remove => Implementation.MouseLeave -= value; 465 + } 466 + 467 + public event EventHandler<EventArgs> MouseEnter 468 + { 469 + add => Implementation.MouseEnter += value; 470 + remove => Implementation.MouseEnter -= value; 471 + } 472 + 473 + public event EventHandler<MouseButtonEventArgs> MouseDown 474 + { 475 + add => Implementation.MouseDown += value; 476 + remove => Implementation.MouseDown -= value; 477 + } 478 + 479 + public event EventHandler<MouseButtonEventArgs> MouseUp 480 + { 481 + add => Implementation.MouseUp += value; 482 + remove => Implementation.MouseUp -= value; 483 + } 484 + 485 + public event EventHandler<MouseMoveEventArgs> MouseMove 486 + { 487 + add => Implementation.MouseMove += value; 488 + remove => Implementation.MouseMove -= value; 489 + } 490 + 491 + public event EventHandler<MouseWheelEventArgs> MouseWheel 492 + { 493 + add => Implementation.MouseWheel += value; 494 + remove => Implementation.MouseWheel -= value; 495 + } 496 + 497 + public event EventHandler<FileDropEventArgs> FileDrop 498 + { 499 + add => Implementation.FileDrop += value; 500 + remove => Implementation.FileDrop -= value; 501 + } 311 502 312 503 #endregion 313 504 }
+1
osu.Framework/Platform/IpcChannel.cs
··· 27 27 { 28 28 if (message.Type != typeof(T).AssemblyQualifiedName) 29 29 return; 30 + 30 31 MessageReceived?.Invoke((T)message.Value); 31 32 } 32 33
+1 -5
osu.Framework/Platform/Linux/LinuxClipboard.cs
··· 7 7 { 8 8 public class LinuxClipboard : Clipboard 9 9 { 10 - public override string GetText() 11 - { 12 - return string.Empty; 13 - // return System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText); 14 - } 10 + public override string GetText() => string.Empty; 15 11 16 12 public override void SetText(string selectedText) 17 13 {
+1
osu.Framework/Platform/MacOS/Native/Class.cs
··· 22 22 var id = objc_getClass(name); 23 23 if (id == IntPtr.Zero) 24 24 throw new ArgumentException("Unknown class: " + name); 25 + 25 26 return id; 26 27 } 27 28
+3 -12
osu.Framework/Platform/MacOS/Native/Cocoa.cs
··· 78 78 FoundationLibrary = (IntPtr)type_cocoa.GetField("FoundationLibrary").GetValue(null); 79 79 } 80 80 81 - public static string FromNSString(IntPtr handle) 82 - { 83 - return (string)method_cocoa_from_ns_string.Invoke(null, new object[] { handle }); 84 - } 81 + public static string FromNSString(IntPtr handle) => (string)method_cocoa_from_ns_string.Invoke(null, new object[] { handle }); 85 82 86 - public static IntPtr ToNSString(string str) 87 - { 88 - return (IntPtr)method_cocoa_to_ns_string.Invoke(null, new object[] { str }); 89 - } 83 + public static IntPtr ToNSString(string str) => (IntPtr)method_cocoa_to_ns_string.Invoke(null, new object[] { str }); 90 84 91 - public static IntPtr GetStringConstant(IntPtr handle, string symbol) 92 - { 93 - return (IntPtr)method_cocoa_get_string_constant.Invoke(null, new object[] { handle, symbol }); 94 - } 85 + public static IntPtr GetStringConstant(IntPtr handle, string symbol) => (IntPtr)method_cocoa_get_string_constant.Invoke(null, new object[] { handle, symbol }); 95 86 } 96 87 }
+3 -4
osu.Framework/Platform/NativeStorage.cs
··· 46 46 return paths.Select(Path.GetFullPath).Select(path => 47 47 { 48 48 if (!path.StartsWith(basePath)) throw new ArgumentException($"\"{path}\" does not start with \"{basePath}\" and is probably malformed"); 49 + 49 50 return path.Substring(basePath.Length).TrimStart(Path.DirectorySeparatorChar); 50 51 }); 51 52 } ··· 76 77 { 77 78 case FileAccess.Read: 78 79 if (!File.Exists(path)) return null; 80 + 79 81 return File.Open(path, FileMode.Open, access, FileShare.Read); 80 82 default: 81 83 return File.Open(path, mode, access); 82 84 } 83 85 } 84 86 85 - public override string GetDatabaseConnectionString(string name) 86 - { 87 - return string.Concat("Data Source=", GetFullPath($@"{name}.db", true)); 88 - } 87 + public override string GetDatabaseConnectionString(string name) => string.Concat("Data Source=", GetFullPath($@"{name}.db", true)); 89 88 90 89 public override void DeleteDatabase(string name) => Delete($@"{name}.db"); 91 90 }
+4
osu.Framework/Platform/Windows/Native/IconGroup.cs
··· 88 88 var entry = iconDir.Entries[i]; 89 89 if (entry.Width == width && entry.Height == height) 90 90 return i; 91 + 91 92 if (entry.Width > requested || entry.Height > requested) 92 93 continue; 94 + 93 95 if (closest < 0 || entry.Width > iconDir.Entries[closest].Width || entry.Height > iconDir.Entries[closest].Height) 94 96 closest = i; 95 97 } 98 + 96 99 return closest; 97 100 } 98 101 ··· 111 114 112 115 if (hIcon == IntPtr.Zero) 113 116 throw new InvalidOperationException("Couldn't create native icon handle."); 117 + 114 118 return new Icon(hIcon, width, height); 115 119 } 116 120
+1
osu.Framework/Platform/Windows/TimePeriod.cs
··· 48 48 set 49 49 { 50 50 if (value == active || !canAdjust) return; 51 + 51 52 active = value; 52 53 53 54 try
+1
osu.Framework/Screens/IScreen.cs
··· 110 110 case null: 111 111 if (onFail != null) 112 112 return onFail.Invoke(); 113 + 113 114 return default; 114 115 case ScreenStack stack: 115 116 return onRoot(stack);
+1
osu.Framework/Screens/ScreenStack.cs
··· 203 203 { 204 204 if (child == source) 205 205 break; 206 + 206 207 child.ValidForResume = false; 207 208 } 208 209 });
+1 -1
osu.Framework/Statistics/BackgroundStackTraceCollector.cs
··· 57 57 /// </summary> 58 58 public bool Enabled 59 59 { 60 - get { return enabled; } 60 + get => enabled; 61 61 set 62 62 { 63 63 if (value == enabled || targetThread == null) return;
+3 -12
osu.Framework/Threading/AtomicCounter.cs
··· 9 9 { 10 10 private long count; 11 11 12 - public long Increment() 13 - { 14 - return Interlocked.Increment(ref count); 15 - } 12 + public long Increment() => Interlocked.Increment(ref count); 16 13 17 - public long Add(long value) 18 - { 19 - return Interlocked.Add(ref count, value); 20 - } 14 + public long Add(long value) => Interlocked.Add(ref count, value); 21 15 22 - public long Reset() 23 - { 24 - return Interlocked.Exchange(ref count, 0); 25 - } 16 + public long Reset() => Interlocked.Exchange(ref count, 0); 26 17 27 18 public long Value 28 19 {
+1
osu.Framework/Threading/AudioThread.cs
··· 45 45 { 46 46 if (managers.Contains(manager)) 47 47 throw new InvalidOperationException($"{manager} was already registered"); 48 + 48 49 managers.Add(manager); 49 50 } 50 51 }
+1 -4
osu.Framework/Threading/ThreadedTaskScheduler.cs
··· 72 72 /// <param name="task">The task to be executed.</param> 73 73 /// <param name="taskWasPreviouslyQueued">Whether the task was previously queued.</param> 74 74 /// <returns>true if the task was successfully inlined; otherwise, false.</returns> 75 - protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 76 - { 77 - return threads.Contains(Thread.CurrentThread) && TryExecuteTask(task); 78 - } 75 + protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) => threads.Contains(Thread.CurrentThread) && TryExecuteTask(task); 79 76 80 77 /// <summary>Gets the maximum concurrency level supported by this scheduler.</summary> 81 78 public override int MaximumConcurrencyLevel => threads.Length;