From 5c4f224faf8751f364129ea8bac34c02e938bd26 Mon Sep 17 00:00:00 2001 From: Warp Date: Sun, 18 Aug 2024 19:37:00 +0200 Subject: [PATCH] new .editorconfig + format everything --- .editorconfig | 594 ++++++++++-------- Quaver.API.Tests/Quaver/TestCaseQua.cs | 12 +- Quaver.API/Maps/AutoMod/AutoMod.cs | 12 +- Quaver.API/Maps/Parsers/OsuBeatmap.cs | 14 +- Quaver.API/Maps/Qua.cs | 12 +- Quaver.API/Maps/Structures/BookmarkInfo.cs | 10 +- Quaver.API/Maps/Structures/HitObjectInfo.cs | 20 +- .../Maps/Structures/SliderVelocityInfo.cs | 9 +- Quaver.API/Maps/Structures/TimingPointInfo.cs | 17 +- Quaver.API/Replays/Replay.cs | 14 +- Quaver.API/Replays/ReplayFrame.cs | 2 +- Quaver.API/Replays/ReplayKeyPressState.cs | 2 +- .../Replays/Virtual/VirtualReplayPlayer.cs | 2 +- Quaver.Tools/Commands/CalcDiffCommand.cs | 2 +- Quaver.Tools/Commands/CalcFolderCommand.cs | 4 +- Quaver.Tools/Commands/Command.cs | 2 +- Quaver.Tools/Commands/RecalculateCommand.cs | 22 +- Quaver.Tools/Commands/ReplayBuildCommand.cs | 4 +- .../Commands/VirtualReplayPlayerCommand.cs | 2 +- 19 files changed, 434 insertions(+), 322 deletions(-) diff --git a/.editorconfig b/.editorconfig index 62319bed2..ece394677 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,267 +1,363 @@ -# http://EditorConfig.org +root = false -################# -# Common Settings -################# - -# This file is the top-most EditorConfig file -root = true - -# All Files +# All files [*] -charset = utf-8 indent_style = space -indent_size = 4 -insert_final_newline = false -trim_trailing_whitespace = true -######################### -# File Extension Settings -######################### +# Xml files +[*.xml] +indent_size = 2 -# Solution Files -[*.sln] -indent_style = tab +# C# files +[*.cs] -# XML Project Files -[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 2 +#### Core EditorConfig Options #### -# XML Configuration Files -[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] -indent_size = 2 +# Indentation and spacing +indent_size = 4 +tab_width = 4 -# JSON Files -[*.{json,json5}] -indent_size = 2 +# New line preferences +# end_of_line = crlf +insert_final_newline = false -# YAML Files -[*.{yml,yaml}] -indent_size = 2 +#### .NET Coding Conventions #### +[*.{cs,vb}] -# Markdown Files -[*.md] -trim_trailing_whitespace = false +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_property = false:silent + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent -# Web Files -[*.{htm,html,js,ts,css,scss,less}] -indent_size = 2 -insert_final_newline = true - -# Batch Files -[*.{cmd,bat}] - -# Bash Files -[*.sh] -end_of_line = lf - -########################### -# .NET Language Conventions -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions -########################### - -# .NET Code Style Settings -[*.{cs,csx,cake,vb}] -# Language keywords instead of framework type names for type references -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords -dotnet_style_predefined_type_for_locals_parameters_members = true:error -dotnet_style_predefined_type_for_member_access = true:error # Modifier preferences -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers -dotnet_style_require_accessibility_modifiers = always:error -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async -visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async -dotnet_style_readonly_field = true:error +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent + # Expression-level preferences -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level -dotnet_style_object_initializer = true:error -dotnet_style_collection_initializer = true:error -dotnet_style_explicit_tuple_names = true:error -dotnet_style_prefer_inferred_tuple_names = true:error -dotnet_style_prefer_inferred_anonymous_type_member_names = true:error -dotnet_style_prefer_auto_properties = true:error -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error -# Null-checking preferences -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking -dotnet_style_coalesce_expression = true:error -dotnet_style_null_propagation = true:error -# Other (Undocumented) -dotnet_style_prefer_conditional_expression_over_return = false -dotnet_style_prefer_conditional_expression_over_assignment = false - -# C# Code Style Settings -[*.{cs,csx,cake}] -# Implicit and explicit types -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types -csharp_style_var_for_built_in_types = true:error -csharp_style_var_when_type_is_apparent = true:error -csharp_style_var_elsewhere = true:error +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +#### C# Coding Conventions #### +[*.cs] + +# var preferences +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + # Expression-bodied members -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members -csharp_style_expression_bodied_methods = true:warning -csharp_style_expression_bodied_constructors = true:error -csharp_style_expression_bodied_operators = true:error -csharp_style_expression_bodied_properties = true:error -csharp_style_expression_bodied_indexers = true:error -csharp_style_expression_bodied_accessors = true:error -# Pattern matching -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching -csharp_style_pattern_matching_over_is_with_cast_check = true:error -csharp_style_pattern_matching_over_as_with_null_check = true:error -# Inlined variable declarations -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations -csharp_style_inlined_variable_declaration = true:error +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + # Expression-level preferences -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp -csharp_prefer_simple_default_expression = true:error -csharp_style_deconstructed_variable_declaration = true:error -csharp_style_pattern_local_over_anonymous_function = true:error -# "Null" checking preferences -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp -csharp_style_throw_expression = true:error -csharp_style_conditional_delegate_call = true:error - -############################# -# .NET Formatting Conventions -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions -############################# +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent -# Organize usings -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings -dotnet_sort_system_directives_first = true:error -# C# formatting settings -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_open_brace = all -csharp_new_line_before_else = true:error -csharp_new_line_before_catch = true:error -csharp_new_line_before_finally = true:error -csharp_new_line_before_members_in_object_initializers = true:error -csharp_new_line_before_members_in_anonymous_types = true:error -csharp_new_line_between_query_expression_clauses = true:error -# Indentation options -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent -csharp_indent_case_contents = true:error -csharp_indent_switch_labels = true:error -csharp_indent_labels = no_change:error -# Spacing options -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing -csharp_space_after_cast = false:error -csharp_space_after_keywords_in_control_flow_statements = true:error -csharp_space_between_method_declaration_parameter_list_parentheses = false:error -csharp_space_between_method_call_parameter_list_parentheses = false:error -csharp_space_between_parentheses = expressions:error -csharp_space_before_colon_in_inheritance_clause = true:error -csharp_space_after_colon_in_inheritance_clause = true:error -csharp_space_around_binary_operators = before_and_after:error -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:error -csharp_space_between_method_call_name_and_opening_parenthesis = false:error -csharp_space_between_method_call_empty_parameter_list_parentheses = false:error -# Wrapping options -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping -csharp_preserve_single_line_statements = false:error -csharp_preserve_single_line_blocks = true:error -# More Indentation options (Undocumented) -csharp_indent_block_contents = true:error -csharp_indent_braces = false:error -# Spacing Options (Undocumented) -csharp_space_after_comma = true:error -csharp_space_after_dot = false:error -csharp_space_after_semicolon_in_for_statement = true:error -csharp_space_around_declaration_statements = do_not_ignore:error -csharp_space_before_comma = false:error -csharp_space_before_dot = false:error -csharp_space_before_semicolon_in_for_statement = false:error -csharp_space_before_open_square_brackets = false:error -csharp_space_between_empty_square_brackets = false:error -csharp_space_between_method_declaration_name_and_open_parenthesis = false:error -csharp_space_between_square_brackets = false:error - -######################### -# .NET Naming conventions -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions -######################### - -[*.{cs,csx,cake,vb}] -# Naming Symbols -# constant_fields - Define constant fields -dotnet_naming_symbols.constant_fields.applicable_kinds = field -dotnet_naming_symbols.constant_fields.required_modifiers = const -# non_private_readonly_fields - Define public, internal and protected readonly fields -dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected -dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly -# static_readonly_fields - Define static and readonly fields -dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly -# private_readonly_fields - Define private readonly fields -dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private -dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly -# public_internal_fields - Define public and internal fields -dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal -dotnet_naming_symbols.public_internal_fields.applicable_kinds = field -# private_protected_fields - Define private and protected fields -dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected -dotnet_naming_symbols.private_protected_fields.applicable_kinds = field -# public_symbols - Define any public symbol -dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal -dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate -# parameters - Defines any parameter +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### +[*.{cs,vb}] + +# Naming rules + +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion +dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces +dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase + +dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion +dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters +dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase + +dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods +dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties +dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.events_should_be_pascalcase.symbols = events +dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables +dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase + +dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants +dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase + +dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion +dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters +dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase + +dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields +dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion +dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields +dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase + +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase + +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums +dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase + +# Symbol specifications + +dotnet_naming_symbols.interfaces.applicable_kinds = interface +dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interfaces.required_modifiers = + +dotnet_naming_symbols.enums.applicable_kinds = enum +dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.enums.required_modifiers = + +dotnet_naming_symbols.events.applicable_kinds = event +dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.events.required_modifiers = + +dotnet_naming_symbols.methods.applicable_kinds = method +dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.methods.required_modifiers = + +dotnet_naming_symbols.properties.applicable_kinds = property +dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.properties.required_modifiers = + +dotnet_naming_symbols.public_fields.applicable_kinds = field +dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_fields.required_modifiers = + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_fields.required_modifiers = + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_fields.required_modifiers = static + +dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum +dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types_and_namespaces.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +dotnet_naming_symbols.type_parameters.applicable_kinds = namespace +dotnet_naming_symbols.type_parameters.applicable_accessibilities = * +dotnet_naming_symbols.type_parameters.required_modifiers = + +dotnet_naming_symbols.private_constant_fields.applicable_kinds = field +dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_constant_fields.required_modifiers = const + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.applicable_accessibilities = local +dotnet_naming_symbols.local_variables.required_modifiers = + +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.applicable_accessibilities = local +dotnet_naming_symbols.local_constants.required_modifiers = const + dotnet_naming_symbols.parameters.applicable_kinds = parameter -# non_interface_types - Defines class, struct, enum and delegate types -dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate -# interface_types - Defines interfaces -dotnet_naming_symbols.interface_types.applicable_kinds = interface - -# Naming Styles -# camel_case - Define the camelCase style -dotnet_naming_style.camel_case.capitalization = camel_case -# pascal_case - Define the Pascal_case style -dotnet_naming_style.pascal_case.capitalization = pascal_case -# first_upper - The first character must start with an upper-case character -dotnet_naming_style.first_upper.capitalization = first_word_upper -# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I' -dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case -dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I - -# Naming Rules -# Constant fields must be PascalCase -dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = error -dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields -dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case -# Public, internal and protected readonly fields must be PascalCase -dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = error -dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields -dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case -# Static readonly fields must be PascalCase -dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = error -dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields -dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case -# Private readonly fields must be camelCase -dotnet_naming_rule.private_readonly_fields_must_be_camel_case.severity = error -dotnet_naming_rule.private_readonly_fields_must_be_camel_case.symbols = private_readonly_fields -dotnet_naming_rule.private_readonly_fields_must_be_camel_case.style = camel_case -# Public and internal fields must be PascalCase -dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = error -dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields -dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case -# Private and protected fields must be camelCase -dotnet_naming_rule.private_protected_fields_must_be_camel_case.severity = error -dotnet_naming_rule.private_protected_fields_must_be_camel_case.symbols = private_protected_fields -dotnet_naming_rule.private_protected_fields_must_be_camel_case.style = camel_case -# Public members must be capitalized -dotnet_naming_rule.public_members_must_be_capitalized.severity = error -dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols -dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper -# Parameters must be camelCase -dotnet_naming_rule.parameters_must_be_camel_case.severity = error -dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters -dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case -# Class, struct, enum and delegates must be PascalCase -dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = error -dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types -dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case -# Interfaces must be PascalCase and start with an 'I' -dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = error -dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types -dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i +dotnet_naming_symbols.parameters.applicable_accessibilities = * +dotnet_naming_symbols.parameters.required_modifiers = + +dotnet_naming_symbols.public_constant_fields.applicable_kinds = field +dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_constant_fields.required_modifiers = const + +dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function +dotnet_naming_symbols.local_functions.applicable_accessibilities = * +dotnet_naming_symbols.local_functions.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascalcase.required_prefix = +dotnet_naming_style.pascalcase.required_suffix = +dotnet_naming_style.pascalcase.word_separator = +dotnet_naming_style.pascalcase.capitalization = pascal_case + +dotnet_naming_style.ipascalcase.required_prefix = I +dotnet_naming_style.ipascalcase.required_suffix = +dotnet_naming_style.ipascalcase.word_separator = +dotnet_naming_style.ipascalcase.capitalization = pascal_case + +dotnet_naming_style.tpascalcase.required_prefix = T +dotnet_naming_style.tpascalcase.required_suffix = +dotnet_naming_style.tpascalcase.word_separator = +dotnet_naming_style.tpascalcase.capitalization = pascal_case + +dotnet_naming_style._camelcase.required_prefix = _ +dotnet_naming_style._camelcase.required_suffix = +dotnet_naming_style._camelcase.word_separator = +dotnet_naming_style._camelcase.capitalization = camel_case + +dotnet_naming_style.camelcase.required_prefix = +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = +dotnet_naming_style.camelcase.capitalization = camel_case + +dotnet_naming_style.s_camelcase.required_prefix = s_ +dotnet_naming_style.s_camelcase.required_suffix = +dotnet_naming_style.s_camelcase.word_separator = +dotnet_naming_style.s_camelcase.capitalization = camel_case diff --git a/Quaver.API.Tests/Quaver/TestCaseQua.cs b/Quaver.API.Tests/Quaver/TestCaseQua.cs index 1d05f332d..8a0ff67b5 100644 --- a/Quaver.API.Tests/Quaver/TestCaseQua.cs +++ b/Quaver.API.Tests/Quaver/TestCaseQua.cs @@ -21,7 +21,7 @@ public void MirrorHitObjects4K() var qua = new Qua { Mode = GameMode.Keys4 }; for (var i = 0; i < qua.GetKeyCount(); i++) - qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1}); + qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1 }); qua.MirrorHitObjects(); @@ -37,7 +37,7 @@ public void MirrorHitObjects7K() var qua = new Qua { Mode = GameMode.Keys7 }; for (var i = 0; i < qua.GetKeyCount(); i++) - qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1}); + qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1 }); qua.MirrorHitObjects(); @@ -56,7 +56,7 @@ public void MirrorHitObjects7KP1() var qua = new Qua { Mode = GameMode.Keys7, HasScratchKey = true }; for (var i = 0; i < qua.GetKeyCount(); i++) - qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1}); + qua.HitObjects.Add(new HitObjectInfo { Lane = i + 1 }); qua.MirrorHitObjects(); @@ -163,7 +163,7 @@ public void SoundEffects() { var qua = Qua.Parse("./Quaver/Resources/sound-effects.qua"); Assert.True(qua.IsValid()); - Assert.Equal(new [] + Assert.Equal(new[] { new CustomAudioSampleInfo() { @@ -176,7 +176,7 @@ public void SoundEffects() UnaffectedByRate = true } }, qua.CustomAudioSamples, CustomAudioSampleInfo.ByValueComparer); - Assert.Equal(new [] + Assert.Equal(new[] { new SoundEffectInfo() { @@ -205,7 +205,7 @@ public void KeySounds() { var qua = Qua.Parse("./Quaver/Resources/keysounds.qua"); Assert.True(qua.IsValid()); - Assert.Equal(new [] + Assert.Equal(new[] { new CustomAudioSampleInfo() { diff --git a/Quaver.API/Maps/AutoMod/AutoMod.cs b/Quaver.API/Maps/AutoMod/AutoMod.cs index 22a8d3e72..ecd0a73f6 100644 --- a/Quaver.API/Maps/AutoMod/AutoMod.cs +++ b/Quaver.API/Maps/AutoMod/AutoMod.cs @@ -139,12 +139,12 @@ private void DetectHitObjectIssues() Issues.Add(new AutoModIssueShortLongNote(hitObject)); // Check if the object is before the object is before the audio begins - if (hitObject.StartTime < 0 || ( hitObject.IsLongNote && hitObject.EndTime < 0 )) + if (hitObject.StartTime < 0 || (hitObject.IsLongNote && hitObject.EndTime < 0)) Issues.Add(new AutoModIssueObjectBeforeStart(hitObject)); // Check if object is after the audio ends - if (AudioTrackInfo != null && ( hitObject.StartTime > AudioTrackInfo.DurationMs - || hitObject.EndTime > AudioTrackInfo.DurationMs )) + if (AudioTrackInfo != null && (hitObject.StartTime > AudioTrackInfo.DurationMs + || hitObject.EndTime > AudioTrackInfo.DurationMs)) { Issues.Add(new AutoModIssueObjectAfterAudioEnd(hitObject)); } @@ -161,7 +161,7 @@ private void DetectHitObjectIssues() // Check for excessive break time. if (hitObject.StartTime - previousObjInMap.StartTime >= BreakTime || - ( previousObjInMap.IsLongNote && hitObject.StartTime - previousObjInMap.EndTime >= BreakTime )) + (previousObjInMap.IsLongNote && hitObject.StartTime - previousObjInMap.EndTime >= BreakTime)) { Issues.Add(new AutoModIssueExcessiveBreakTime(previousObjInMap)); } @@ -228,7 +228,7 @@ private void DetectTimingPointIssues() { var current = Qua.TimingPoints[i]; - if (AudioTrackInfo != null && ( current.StartTime > AudioTrackInfo.DurationMs )) + if (AudioTrackInfo != null && (current.StartTime > AudioTrackInfo.DurationMs)) Issues.Add(new AutoModIssueTimingPointAfterAudioEnd(current)); if (i == 0) @@ -251,7 +251,7 @@ private void DetectScrollVelocityIssues() { var current = Qua.SliderVelocities[i]; - if (AudioTrackInfo != null && ( current.StartTime > AudioTrackInfo.DurationMs )) + if (AudioTrackInfo != null && (current.StartTime > AudioTrackInfo.DurationMs)) Issues.Add(new AutoModIssueScrollVelocityAfterEnd(current)); if (i == 0) diff --git a/Quaver.API/Maps/Parsers/OsuBeatmap.cs b/Quaver.API/Maps/Parsers/OsuBeatmap.cs index a3a399c8a..4cc6201bc 100644 --- a/Quaver.API/Maps/Parsers/OsuBeatmap.cs +++ b/Quaver.API/Maps/Parsers/OsuBeatmap.cs @@ -356,8 +356,8 @@ public OsuBeatmap(string filePath) var timingPoint = new OsuTimingPoint { Offset = float.Parse(values[0], CultureInfo.InvariantCulture), - MillisecondsPerBeat = (float) msecPerBeat, - Signature = values[2][0] == '0' ? TimeSignature.Quadruple : (TimeSignature) int.Parse(values[2], CultureInfo.InvariantCulture), + MillisecondsPerBeat = (float)msecPerBeat, + Signature = values[2][0] == '0' ? TimeSignature.Quadruple : (TimeSignature)int.Parse(values[2], CultureInfo.InvariantCulture), SampleType = int.Parse(values[3], CultureInfo.InvariantCulture), SampleSet = int.Parse(values[4], CultureInfo.InvariantCulture), Volume = Math.Max(0, int.Parse(values[5], CultureInfo.InvariantCulture)), @@ -389,8 +389,8 @@ public OsuBeatmap(string filePath) X = int.Parse(values[0], CultureInfo.InvariantCulture), Y = int.Parse(values[1], CultureInfo.InvariantCulture), StartTime = int.Parse(values[2], CultureInfo.InvariantCulture), - Type = (HitObjectType) int.Parse(values[3], CultureInfo.InvariantCulture), - HitSound = (HitSoundType) int.Parse(values[4], CultureInfo.InvariantCulture), + Type = (HitObjectType)int.Parse(values[3], CultureInfo.InvariantCulture), + HitSound = (HitSoundType)int.Parse(values[4], CultureInfo.InvariantCulture), Additions = "0:0:0:0:", KeySound = -1 }; @@ -558,7 +558,7 @@ public Qua ToQua(bool checkValidity = true) foreach (var hitObject in HitObjects) { // Get the keyLane the hitObject is in - var keyLane = (int) (hitObject.X / (512d / KeyCount)).Clamp(0, KeyCount - 1) + 1; + var keyLane = (int)(hitObject.X / (512d / KeyCount)).Clamp(0, KeyCount - 1) + 1; // osu! considers objects in lane 1 to be the special key, Quaver considers it to be the last lane. // Lane 8 on 7K+1 @@ -679,13 +679,13 @@ public static class HitSoundTypeExtension /// public static HitSounds ToQuaverHitSounds(this HitSoundType hitSoundType) { - var value = (int) hitSoundType & 15; // Clear any higher bits. + var value = (int)hitSoundType & 15; // Clear any higher bits. if (value == 0) return HitSounds.Normal; // HitSounds happens to have the same values. - return (HitSounds) hitSoundType; + return (HitSounds)hitSoundType; } } diff --git a/Quaver.API/Maps/Qua.cs b/Quaver.API/Maps/Qua.cs index f7a79b4a3..887e324cc 100644 --- a/Quaver.API/Maps/Qua.cs +++ b/Quaver.API/Maps/Qua.cs @@ -362,7 +362,7 @@ public string Serialize() Bookmarks = null; var serializer = new Serializer(); - using var stringWriter = new StringWriter {NewLine = "\r\n"}; + using var stringWriter = new StringWriter { NewLine = "\r\n" }; serializer.Serialize(stringWriter, this); var serialized = stringWriter.ToString(); @@ -565,7 +565,7 @@ public float GetCommonBpm() if (point.StartTime > lastTime) continue; - var duration = (int) (lastTime - (i == 0 ? 0 : point.StartTime)); + var duration = (int)(lastTime - (i == 0 ? 0 : point.StartTime)); lastTime = point.StartTime; if (durations.ContainsKey(point.Bpm)) @@ -819,7 +819,7 @@ public void ApplyInverse() // For example, consider a fast section of the map transitioning into a very low BPM ending starting // with the next hit object. Since the LN release and the gap are still in the fast section, they // should use the fast section's BPM. - if ((int) Math.Round(timingPoint.StartTime) == nextObjectInLane.StartTime) + if ((int)Math.Round(timingPoint.StartTime) == nextObjectInLane.StartTime) { var prevTimingPointIndex = TimingPoints.FindLastIndex(x => x.StartTime < timingPoint.StartTime); @@ -836,7 +836,7 @@ public void ApplyInverse() } // The time gap is quarter of the milliseconds per beat. - timeGap = (int?) Math.Max(Math.Round(15000 / bpm), MINIMAL_GAP_LENGTH); + timeGap = (int?)Math.Max(Math.Round(15000 / bpm), MINIMAL_GAP_LENGTH); } // Summary of the changes: @@ -1380,7 +1380,7 @@ public void DenormalizeSVs() /// public Qua WithNormalizedSVs() { - var qua = (Qua) MemberwiseClone(); + var qua = (Qua)MemberwiseClone(); // Relies on NormalizeSVs not changing anything within the by-reference members (but rather creating a new List). qua.NormalizeSVs(); return qua; @@ -1392,7 +1392,7 @@ public Qua WithNormalizedSVs() /// public Qua WithDenormalizedSVs() { - var qua = (Qua) MemberwiseClone(); + var qua = (Qua)MemberwiseClone(); // Relies on DenormalizeSVs not changing anything within the by-reference members (but rather creating a new List). qua.DenormalizeSVs(); return qua; diff --git a/Quaver.API/Maps/Structures/BookmarkInfo.cs b/Quaver.API/Maps/Structures/BookmarkInfo.cs index 6507e9d13..8a358c5cc 100644 --- a/Quaver.API/Maps/Structures/BookmarkInfo.cs +++ b/Quaver.API/Maps/Structures/BookmarkInfo.cs @@ -11,14 +11,16 @@ public class BookmarkInfo { public int StartTime { - get; - [MoonSharpVisible(false)] set; + get; + [MoonSharpVisible(false)] + set; } public string Note { - get; - [MoonSharpVisible(false)] set; + get; + [MoonSharpVisible(false)] + set; } private sealed class TimeNoteEqualityComparer : IEqualityComparer diff --git a/Quaver.API/Maps/Structures/HitObjectInfo.cs b/Quaver.API/Maps/Structures/HitObjectInfo.cs index 61ce6e234..19490dfd1 100644 --- a/Quaver.API/Maps/Structures/HitObjectInfo.cs +++ b/Quaver.API/Maps/Structures/HitObjectInfo.cs @@ -29,7 +29,8 @@ public class HitObjectInfo public int StartTime { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -38,7 +39,8 @@ public int StartTime public int Lane { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -47,7 +49,8 @@ public int Lane public int EndTime { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -56,7 +59,8 @@ public int EndTime public HitSounds HitSound { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -71,7 +75,8 @@ public HitSounds HitSound public int EditorLayer { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -87,7 +92,8 @@ public int EditorLayer public bool IsEditableInLuaScript { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -173,7 +179,7 @@ public int GetHashCode(HitObjectInfo obj) var hashCode = obj.StartTime; hashCode = (hashCode * 397) ^ obj.Lane; hashCode = (hashCode * 397) ^ obj.EndTime; - hashCode = (hashCode * 397) ^ (int) obj.HitSound; + hashCode = (hashCode * 397) ^ (int)obj.HitSound; foreach (var keySound in obj.KeySounds) hashCode = (hashCode * 397) ^ KeySoundInfo.ByValueComparer.GetHashCode(keySound); hashCode = (hashCode * 397) ^ obj.EditorLayer; diff --git a/Quaver.API/Maps/Structures/SliderVelocityInfo.cs b/Quaver.API/Maps/Structures/SliderVelocityInfo.cs index ff3153851..d0cf70296 100644 --- a/Quaver.API/Maps/Structures/SliderVelocityInfo.cs +++ b/Quaver.API/Maps/Structures/SliderVelocityInfo.cs @@ -26,7 +26,8 @@ public class SliderVelocityInfo public float StartTime { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -35,7 +36,8 @@ public float StartTime public float Multiplier { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -45,7 +47,8 @@ public float Multiplier public bool IsEditableInLuaScript { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// diff --git a/Quaver.API/Maps/Structures/TimingPointInfo.cs b/Quaver.API/Maps/Structures/TimingPointInfo.cs index 492a2ae7c..cbfc3e198 100644 --- a/Quaver.API/Maps/Structures/TimingPointInfo.cs +++ b/Quaver.API/Maps/Structures/TimingPointInfo.cs @@ -27,7 +27,8 @@ public class TimingPointInfo public float StartTime { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -36,7 +37,8 @@ public float StartTime public float Bpm { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -45,7 +47,8 @@ public float Bpm public TimeSignature Signature { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -54,14 +57,16 @@ public TimeSignature Signature public bool Hidden { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } [YamlIgnore] public bool IsEditableInLuaScript { get; - [MoonSharpVisible(false)] set; + [MoonSharpVisible(false)] + set; } /// @@ -90,7 +95,7 @@ public int GetHashCode(TimingPointInfo obj) { var hashCode = obj.StartTime.GetHashCode(); hashCode = (hashCode * 397) ^ obj.Bpm.GetHashCode(); - hashCode = (hashCode * 397) ^ (int) obj.Signature; + hashCode = (hashCode * 397) ^ (int)obj.Signature; hashCode = (hashCode * 397) ^ (obj.Hidden ? 1 : 0); return hashCode; } diff --git a/Quaver.API/Replays/Replay.cs b/Quaver.API/Replays/Replay.cs index 6dcf0416d..d0af0977c 100644 --- a/Quaver.API/Replays/Replay.cs +++ b/Quaver.API/Replays/Replay.cs @@ -195,11 +195,11 @@ public Replay(string path, bool readHeaderless = false) mods &= ~(1 << 31); } // Add the rest of the mods. - Mods |= (ModIdentifier) mods; + Mods |= (ModIdentifier)mods; } else { - Mods = (ModIdentifier) br.ReadInt64(); + Mods = (ModIdentifier)br.ReadInt64(); } Score = br.ReadInt32(); @@ -279,9 +279,9 @@ public void Write(string path) // This check is to keep compatibility with older clients. // We only want to write a 64-bit integer for replays with newer mods activated if (ReplayVersion == "0.0.1" || Mods < ModIdentifier.Speed105X) - bw.Write((int) Mods); + bw.Write((int)Mods); else - bw.Write((long) Mods); + bw.Write((long)Mods); bw.Write(Score); bw.Write(Accuracy); bw.Write(MaxCombo); @@ -438,7 +438,7 @@ public static List KeyPressStateToLanes(ReplayKeyPressState keys) if (keys.HasFlag(ReplayKeyPressState.K9)) lanes.Add(8); - return lanes; + return lanes; } /// @@ -511,8 +511,8 @@ public List GetKeyPresses() /// public string GetMd5(string frames) { - return CryptoHelper.StringToMd5($"{ReplayVersion}-{TimePlayed}-{MapMd5}-{PlayerName}-{(int) Mode}-" + - $"{(int) Mods}-{Score}-{Accuracy}-{MaxCombo}-{CountMarv}-{CountPerf}-" + + return CryptoHelper.StringToMd5($"{ReplayVersion}-{TimePlayed}-{MapMd5}-{PlayerName}-{(int)Mode}-" + + $"{(int)Mods}-{Score}-{Accuracy}-{MaxCombo}-{CountMarv}-{CountPerf}-" + $"{CountGreat}-{CountGood}-{CountOkay}-{CountMiss}-{PauseCount}-{RandomizeModifierSeed}-{frames}"); } } diff --git a/Quaver.API/Replays/ReplayFrame.cs b/Quaver.API/Replays/ReplayFrame.cs index 0678c44f1..6a26c964e 100644 --- a/Quaver.API/Replays/ReplayFrame.cs +++ b/Quaver.API/Replays/ReplayFrame.cs @@ -30,7 +30,7 @@ public ReplayFrame(int time, ReplayKeyPressState keys) Keys = keys; } - public override string ToString() => $"{Time}|{(int) Keys}"; + public override string ToString() => $"{Time}|{(int)Keys}"; public string ToDebugString() => $"{Time}|{Keys}"; } diff --git a/Quaver.API/Replays/ReplayKeyPressState.cs b/Quaver.API/Replays/ReplayKeyPressState.cs index 8af1eca47..b11ebf5bd 100644 --- a/Quaver.API/Replays/ReplayKeyPressState.cs +++ b/Quaver.API/Replays/ReplayKeyPressState.cs @@ -23,6 +23,6 @@ public enum ReplayKeyPressState K6 = 1 << 5, K7 = 1 << 6, K8 = 1 << 7, - K9 = 1<< 8 // Scratch Lane Second Key on 7K+1 + K9 = 1 << 8 // Scratch Lane Second Key on 7K+1 } } diff --git a/Quaver.API/Replays/Virtual/VirtualReplayPlayer.cs b/Quaver.API/Replays/Virtual/VirtualReplayPlayer.cs index a2cc22aef..ee055a6d9 100644 --- a/Quaver.API/Replays/Virtual/VirtualReplayPlayer.cs +++ b/Quaver.API/Replays/Virtual/VirtualReplayPlayer.cs @@ -18,7 +18,7 @@ namespace Quaver.API.Replays.Virtual { public class VirtualReplayPlayer { - /// + /// /// The replay that's being played. /// public Replay Replay { get; } diff --git a/Quaver.Tools/Commands/CalcDiffCommand.cs b/Quaver.Tools/Commands/CalcDiffCommand.cs index 89013a945..1329af304 100644 --- a/Quaver.Tools/Commands/CalcDiffCommand.cs +++ b/Quaver.Tools/Commands/CalcDiffCommand.cs @@ -40,7 +40,7 @@ public CalcDiffCommand(string[] args) : base(args) else if (path.EndsWith(".osu")) Map = new OsuBeatmap(path).ToQua(); - Mods = (ModIdentifier) Enum.Parse(typeof(ModIdentifier), args[2]); + Mods = (ModIdentifier)Enum.Parse(typeof(ModIdentifier), args[2]); Map.ApplyMods(Mods); } diff --git a/Quaver.Tools/Commands/CalcFolderCommand.cs b/Quaver.Tools/Commands/CalcFolderCommand.cs index 502cf9f4a..693a85d35 100644 --- a/Quaver.Tools/Commands/CalcFolderCommand.cs +++ b/Quaver.Tools/Commands/CalcFolderCommand.cs @@ -28,7 +28,7 @@ internal class CalcFolderCommand : Command /// /// /// - public ModIdentifier Mods { get; } + public ModIdentifier Mods { get; } /// /// @@ -75,7 +75,7 @@ public override void Execute() } } - var table = calculatedMaps.ToStringTable(new[] {"Id", "Map", "Difficulty"}, a => a.Item1, a => a.Item2, a => a.Item3); + var table = calculatedMaps.ToStringTable(new[] { "Id", "Map", "Difficulty" }, a => a.Item1, a => a.Item2, a => a.Item3); Console.WriteLine(table); File.WriteAllText("./diff-calc.txt", table); diff --git a/Quaver.Tools/Commands/Command.cs b/Quaver.Tools/Commands/Command.cs index 3ca68c2a5..65b3a359d 100644 --- a/Quaver.Tools/Commands/Command.cs +++ b/Quaver.Tools/Commands/Command.cs @@ -9,7 +9,7 @@ namespace Quaver.Tools.Commands { public abstract class Command { - public Command(string[] args) {} + public Command(string[] args) { } public abstract void Execute(); } } diff --git a/Quaver.Tools/Commands/RecalculateCommand.cs b/Quaver.Tools/Commands/RecalculateCommand.cs index 776d52643..f27d110d9 100644 --- a/Quaver.Tools/Commands/RecalculateCommand.cs +++ b/Quaver.Tools/Commands/RecalculateCommand.cs @@ -54,39 +54,39 @@ private void Recalculate(JToken scores) // Make a dummy Qua for this score var qua = new Qua(); - var totalObjects = (int) score["count_marv"] + (int) score["count_perf"] + (int) score["count_great"] + - (int) score["count_good"] + (int) score["count_okay"] + (int)score["count_miss"]; + var totalObjects = (int)score["count_marv"] + (int)score["count_perf"] + (int)score["count_great"] + + (int)score["count_good"] + (int)score["count_okay"] + (int)score["count_miss"]; for (var i = 0; i < totalObjects; i++) qua.HitObjects.Add(new HitObjectInfo()); var processor = new ScoreProcessorKeys(qua, 0); - for (var i = 0; i < (int) score["count_marv"]; i++) + for (var i = 0; i < (int)score["count_marv"]; i++) processor.CalculateScore(Judgement.Marv); - for (var i = 0; i < (int) score["count_perf"]; i++) + for (var i = 0; i < (int)score["count_perf"]; i++) processor.CalculateScore(Judgement.Perf); - for (var i = 0; i < (int) score["count_great"]; i++) + for (var i = 0; i < (int)score["count_great"]; i++) processor.CalculateScore(Judgement.Great); - for (var i = 0; i < (int) score["count_good"]; i++) + for (var i = 0; i < (int)score["count_good"]; i++) processor.CalculateScore(Judgement.Good); - for (var i = 0; i < (int) score["count_okay"]; i++) + for (var i = 0; i < (int)score["count_okay"]; i++) processor.CalculateScore(Judgement.Okay); - for (var i = 0; i < (int) score["count_miss"]; i++) + for (var i = 0; i < (int)score["count_miss"]; i++) processor.CalculateScore(Judgement.Miss); - var difficultyRating = (double) score["performance_rating"] / Math.Pow((double) score["accuracy"] / 98, 6); + var difficultyRating = (double)score["performance_rating"] / Math.Pow((double)score["accuracy"] / 98, 6); comparedScores.Add(new ComparedScores($"{score["map"]["artist"]} - {score["map"]["title"]} [{score["map"]["difficulty_name"]}]", - (double) score["accuracy"], processor.Accuracy, (double) score["performance_rating"], difficultyRating)); + (double)score["accuracy"], processor.Accuracy, (double)score["performance_rating"], difficultyRating)); } - Console.WriteLine(comparedScores.ToStringTable(new [] + Console.WriteLine(comparedScores.ToStringTable(new[] { "Map Name", "Difficulty", diff --git a/Quaver.Tools/Commands/ReplayBuildCommand.cs b/Quaver.Tools/Commands/ReplayBuildCommand.cs index 106b63128..4844f086e 100644 --- a/Quaver.Tools/Commands/ReplayBuildCommand.cs +++ b/Quaver.Tools/Commands/ReplayBuildCommand.cs @@ -41,8 +41,8 @@ public ReplayBuildCommand(string[] args) : base(args) MapMd5 = args[4], PlayerName = string.Join(" ", username), TimePlayed = long.Parse(args[5]), - Mode = (GameMode) int.Parse(args[6]), - Mods = (ModIdentifier) long.Parse(args[7]), + Mode = (GameMode)int.Parse(args[6]), + Mods = (ModIdentifier)long.Parse(args[7]), Score = int.Parse(args[8]), Accuracy = float.Parse(args[9]), MaxCombo = int.Parse(args[10]), diff --git a/Quaver.Tools/Commands/VirtualReplayPlayerCommand.cs b/Quaver.Tools/Commands/VirtualReplayPlayerCommand.cs index f283b3922..b05ec1f8f 100644 --- a/Quaver.Tools/Commands/VirtualReplayPlayerCommand.cs +++ b/Quaver.Tools/Commands/VirtualReplayPlayerCommand.cs @@ -47,7 +47,7 @@ public VirtualReplayPlayerCommand(string[] args) : base(args) readHeaderLess = true; } - Replay = new Replay(args[1], readHeaderLess) { Mods = (ModIdentifier) long.Parse(args[3]) }; + Replay = new Replay(args[1], readHeaderLess) { Mods = (ModIdentifier)long.Parse(args[3]) }; if (args[2].EndsWith(".qua")) Map = Qua.Parse(args[2]);