Skip to content

Commit 447bd6c

Browse files
2 parents c04a4c4 + 05fab33 commit 447bd6c

File tree

122 files changed

+6769
-3565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6769
-3565
lines changed

.editorconfig

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
4747
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
4848
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
4949
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
50-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
50+
dotnet_style_parentheses_in_other_operators = always_for_clarity:suggestion
5151
# Modifier preferences
5252
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
5353
dotnet_style_readonly_field = true:suggestion
@@ -61,8 +61,12 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggesti
6161
dotnet_style_prefer_inferred_tuple_names = true:suggestion
6262
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
6363
dotnet_style_prefer_auto_properties = true:suggestion
64-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
65-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
64+
# If true, the settings below make one-liners out of every conditional statement,
65+
# which reduces the readability. It varies depending on the situation, so we set
66+
# these warnings to none.
67+
dotnet_style_prefer_conditional_expression_over_assignment = false:none
68+
dotnet_style_prefer_conditional_expression_over_return = false:none
69+
6670
###############################
6771
# Naming Conventions #
6872
###############################
@@ -82,7 +86,8 @@ dotnet_naming_symbols.constant_fields.required_modifiers = const
8286
# var preferences
8387
csharp_style_var_for_built_in_types = false:suggestion
8488
csharp_style_var_when_type_is_apparent = false:suggestion
85-
csharp_style_var_elsewhere = false:suggestion
89+
# For all else, we prefer non-var but don't enforce it
90+
csharp_style_var_elsewhere = false:none
8691
# Expression-bodied members
8792
csharp_style_expression_bodied_methods = false:suggestion
8893
csharp_style_expression_bodied_constructors = false:suggestion
@@ -138,3 +143,8 @@ csharp_preserve_single_line_blocks = true
138143
# YAFC-CE Code Style #
139144
###############################
140145
dotnet_diagnostic.IDE0055.severity = error
146+
# Disable "IDE0130: Namespace does not match folder structure" because VS Code Cleanup applies it automatically and breaks things.
147+
dotnet_style_namespace_match_folder = false
148+
149+
# Suppress IDE0047: Remove unnecessary parentheses. Parentheses improve readability.
150+
dotnet_diagnostic.IDE0047.severity = none

.github/ISSUE_TEMPLATE/error-while-loading-mods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Error while loading mods
33
about: Error while loading mods
4-
title: "[Loading error]"
4+
title: ""
55
labels: bug
66
assignees: ''
77

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[Feature request]"
4+
title: ""
55
labels: enhancement
66
assignees: ''
77

.github/ISSUE_TEMPLATE/generic-bug-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Generic bug report
33
about: Bug report
4-
title: "[Bug summary]"
4+
title: ""
55
labels: bug
66
assignees: ''
77

@@ -15,4 +15,4 @@ assignees: ''
1515
- If the bug is about mods, attach a new-game save-file so we can sync the mods with yours.
1616
- If the bug is about your .yafc project, such as errors in calculations, then attach your .yafc file.
1717
- Describe the steps to reproduce the issue, the expected result, and the actual result.
18-
- If possible, please provide a minimal example to reproduce the issue.
18+
- If possible, please provide a minimal example to reproduce the issue. For example, check if the bug can be reproduced on a fresh project instead of the usual one. Try to use as few mods as possible.

CommandLineToolExample/CommandLineToolExample.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
<RootNamespace>YafcCommandLineToolExample</RootNamespace>
66
<LangVersion>8</LangVersion>
77
<OutputType>Exe</OutputType>
8+
<PlatformTarget>x64</PlatformTarget>
89
</PropertyGroup>
910

1011
<ItemGroup>
1112
<ProjectReference Include="..\YAFCmodel\YAFCmodel.csproj" />
13+
<ProjectReference Include="..\YAFCparser\YAFCparser.csproj" />
1214
<ProjectReference Include="..\YAFC\YAFC.csproj" />
1315
</ItemGroup>
1416

CommandLineToolExample/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public static void Main(string[] args) {
1414
}
1515
YafcLib.Init();
1616
YafcLib.RegisterDefaultAnalysis(); // Register analysis to get cost, milestones, accessibility, etc information. Skip if you just need data.
17-
var factorioPath = args[0];
18-
var errorCollector = new ErrorCollector();
17+
string factorioPath = args[0];
18+
ErrorCollector errorCollector = new ErrorCollector();
1919
Project project;
2020
try {
2121
// Load YAFC project.

Docs/ContributorsGuide.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Contributor's Guide
22

3-
To make your experience better, there are a couple of things to keep in mind when working on a Pull Request:
3+
Here are a couple of things to make your experience in the community more enjoyable.
44

5-
Coding phase:
6-
* Please use the same code style as the rest of the codebase.
5+
## Coding
6+
* Please use the same code style as the rest of the codebase. Visual Studio should pick up most of it from `.editorconfig`.
77
* Please prioritize maintainability. Aim for understandable code without dirty hacks.
88
* Please separate refactoring and the change of behavior into different commits, so it is easier to review the PR.
9-
* Please document the code. If you can also document the existing code, we would be thankful. Better documentation allows others to understand the code faster and thus to contribute more.
10-
* In a programmers' haven, there's a spot for devs who write tests.
9+
* Please document the code. If you also can document the existing code, that would be awesome. More documentation helps others to understand the code faster and make the work on YAFC more enjoyable.
10+
* Feel free to put [prefixes](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#summary) in the subjects of your commits -- they might help to browse them later.
11+
* In the programmers-haven, there is always a free spot for those who write tests.
1112

12-
PR preparation phase:
13-
* When making a Pull Request, give as much context as possible.
14-
* If there's no corresponding issue, then describe what the problem was and how your PR fixes it. For instance, context, state without the fix, state with the fix.
15-
* Make meaningful commit messages. The easier it is to understand your PR, the faster it will be merged.
16-
* If you feel fancy, reorganize your commits - separate and squash them into logical steps, so they are understood even better.
13+
## Pull Request
14+
* When making a Pull Request, please give some context. For instance, if the PR solves an issue, then you can put a short description of the issue in the PR.
15+
* If there's no corresponding issue, then describe what the problem was and how your PR fixes it. The context, the state without the fix, and with the fix.
1716
* Please provide a short description of your change in the [changelog](https://github.com/have-fun-was-taken/yafc-ce/blob/master/changelog.txt).
17+
* Make meaningful commit messages. The easier it is to understand your PR, the faster it will be merged.
18+
* It would be appreciated if you reorganize your commits before the merge -- separate and squash them into logical steps, so they are easier to review and understand. For instance, the fixes to the commits can be squashed into them. The reordering of the commits can be done with the interactive rebase: `git rebase -i head~n`, but please read beforehand on how to do it, so you don't accidentally delete your efforts. If you want to go godlike, feel free to read on `git commit --fixup=` and `git rebase -i --autosquash` ([example](https://stackoverflow.com/questions/3103589/how-can-i-easily-fixup-a-past-commit)). However, it can be the case that the reordering requires very tricky merges, so it's okay to leave them as-is in this case.

Docs/MoreLanguagesSupport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# YAFC support for more languages
22

3-
YAFC language support is exprimental. If your language is missing, that is probably because of one of two reasons:
3+
YAFC language support is experimental. If your language is missing, that is probably because of one of two reasons:
44

55
- It has less than 90% support in official Factorio translation
66
- It uses non-european glyphs (such as Chinese or Japanese languages)

Docs/TipsAndTricks.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The tips are ordered by the progression through the game.
44

5+
### Electricity generation
6+
7+
When trying to calculate how much electricity a certain amount of fuel would generate, there is no consumption recipe in the list that would take this fuel and convert it into the electirity.
8+
That's because the electricity recipe is special, so you need to add it by either clicking on the Electricity icon and selecting the sole production recipe there is, or through the dropdown menu on the top left:
9+
Recipe > Add Recipe > Electricity.
10+
511
### Desired expenditure
612

713
Sometimes it's more convenient to set up ore expenditure rather than the amount of the final product. You can do it by putting the ore into Desired Products and assigning it a negative number.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Yes, we have their approval.
1212
</details>
1313

1414
## What is YAFC?
15-
Yet Another Factorio Calculator or YAFC is a planner and analyser. The main goal of YAFC is to help with heavily modded Factorio games.
15+
Yet Another Factorio Calculator or YAFC is a planner and analyzer. The main goal of YAFC is to help with heavily modded Factorio games.
1616

1717
<details>
1818
<summary>Expand to see what YAFC can do</summary>
@@ -48,7 +48,7 @@ For tricky use cases, please refer to the [Tips and Tricks](/Docs/TipsAndTricks.
4848
- Nested sheets: You can attach a nested sheet to any recipe. When a sheet is collapsed, you will see a summary for all recipes in it. Nested sheets have their own set of links. For example, you can create a nested sheet for electronic circuits, and put copper cables inside that sheet. If you add an internal link for copper cables, it will be separate, so you can calculate copper cables just for electronic circuits.
4949
- Auto modules: You can add modules to recipes by using a single slider. Based on your milestones, it will automatically add modules you have access to. It will prioritize putting modules into buildings that benefit the most from them. <details><summary>Expand to see it in action</summary><IMG src="/Docs/Media/AutoModules.gif" alt="AutoModules.gif"/></details>
5050
- Fluid temperatures, although without mixing them, allow to calculate energy generation.
51-
- Fuel, including electricity. You can even add energy generation exactly enough for your sheet. Howerver, inserters are not included.
51+
- Fuel, including electricity. You can even add energy generation exactly enough for your sheet. However, inserters are not included.
5252
- Multiple analyses:
5353
- Accessibility analysis: Shows inaccessible objects. Mods often hide objects, and Factorio has a bunch of hidden ones too. However, it is impossible to find objects that are spawned by mods or map scripts. This analysis may fail for modpacks like Seablock, but you can mark some objects as accessible manually.
5454
- Milestone analysis: You can add anything as a milestone. YAFC will display that milestone icon on every object that is locked behind it, directly or indirectly. Science packs are natural milestones, and so they are added by default.

0 commit comments

Comments
 (0)