Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BuilderCAI static caches into new BuilderCaches file. #1890

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saurtron
Copy link
Collaborator

@saurtron saurtron commented Jan 11, 2025

Work done

  • Factor out static caches from BuilderCAI

Remarks

@saurtron saurtron added the refactor Internal code cleanup; paying off technical debt; janitorial work. label Jan 11, 2025
@sprunk sprunk added the status: candidate PRs that should be good to go or important for next release label Jan 12, 2025

class CUnit;

class CBuilderCaches
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's an instanceless class (not even a singleton needed) perhaps it should be a namespace with regular functions? See #1651 (comment)

#include "Sim/Units/UnitHandler.h"
#include "Sim/Units/Unit.h"

// not adding to members, should repopulate itself
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously it was obvious what "members" were because this chunk was right under a bunch of creg registrations

Suggested change
// not adding to members, should repopulate itself
// not adding to creg, should repopulate itself

@@ -0,0 +1,147 @@
#include "Sim/Units/CommandAI/BuilderCaches.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs the licence notice at the top (as Spring, since it's entirely old code)

Suggested change
#include "Sim/Units/CommandAI/BuilderCaches.h"
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
#include "Sim/Units/CommandAI/BuilderCaches.h"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Internal code cleanup; paying off technical debt; janitorial work. status: candidate PRs that should be good to go or important for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants