Skip to content

Conversation

@zack-the-coding-actuary
Copy link
Contributor

Is now based on how the C7.GameData.Difficulty object is instantiated. Hope this little tiny bit is helpful!

@esbudylin esbudylin linked an issue Jan 4, 2026 that may be closed by this pull request
@esbudylin
Copy link
Contributor

You can't access AIToAITradeRate field directly from Difficulty class, since this field is non-static. You should access the game difficulty instance via EngineStorage (EngineStorage.gameData.gameDifficulty)

Was trying to use Python semantics to import references to EngineStorage.cs, believe we got it right now as the project builds locally now.
@zack-the-coding-actuary
Copy link
Contributor Author

Think I got the namespace issue ironed out, project builds locally now. Thanks for helping me get set up to contribute!

@stavrosfa
Copy link
Contributor

@zack-the-coding-actuary
If you see the bottom of the page, you will see a section that says "All checks have failed".
That is an automated pipeline that runs every time we make a commit and checks if the project can build, runs unit tests etc. In your first commit it failed as it couldn't build because of the reasons discussed above. Now, if you check again, you will see that it failed because of the formatting.
This is not something you necessarily did wrong yourself, Rider does that for me sometimes too if I edit a file from the commit window for example.
The first line of the error also tells you what to do to fix it.
You need to run this in your terminal:
dotnet format C7/C7.sln whitespace

All checks should pass.

Things to consider for future PRs
As a rule of thumb, I run all the unit tests in the EngineTests project (there should be a Run all tests button or something similar in VS if you right click on the project) before I commit anything, just to make sure everything is ok.
I also prefer to create a new branch for each of the things I am working on, I am not pushing directly from my Development branch.
You could also read on best practices for naming the branches like feat(ure)/short-description, fix/short-description, etc.

@zack-the-coding-actuary
Copy link
Contributor Author

Okay cool! Thanks for bearing with me here, this is my first real collaboration project where I need to get up to speed on GitHub hygiene and best practices. I actually opened a PR on a different issue last night and successfully renamed the branch before committing, so I promise I won't make that mistake again :)

My latest commit on this one ran the whitespace command from CMD, so I reckon we should be good to go here.

However, when I navigate to the EngineTests folder and run dotnet test --logger "console;verbosity=detailed", I get one error.

error TESTERROR: EngineTests.GameData.SaveTests.LoadAllConquestScenarios (8s 400ms): Error Message: 1vAll.biq: System.IO.DirectoryN otFoundException: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civ ilization III Complete\Conquests\Scenarios\Text\PediaIcons.txt'.

I take it it's not ready for the pipeline unit tests if it's failing this one?

@esbudylin esbudylin merged commit 9ecbc5a into C7-Game:Development Jan 5, 2026
3 checks passed
@esbudylin
Copy link
Contributor

I've responded about the test failure on Discord. TLDR: it's a bug in the test and is unrelated to this PR. The code looks good to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hook up the AI-to-AI trade rate

3 participants