Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SJuliez
Copy link
Member

@SJuliez SJuliez commented May 3, 2024

This is another step towards supporting other game types, oriented mostly towards SBF, but the AbstractGame and AbstractGameManager changes will benefit all. As before this PR should ideally not show any visible changes.
The code changes are:

  • moved up deployment table handling from Game to AbstractGame and removed the focus on Entity
  • added a Deployable interface for deployable units/objects. This is distinct from InGameObject as there are InGameObjects such as HexTarget that cant be deployed. It is possible that having Targetable extend InGameObject was not a wise move by me
  • moved up the pendingActions list to AbstractGame
  • moves the answer to "should this phase be skipped now" from GamePhase into the *Game classes as this is game and situation specific
  • copied a whole lot of phase handling from GameManager to SBFGameManager. Most of it is commented out but I added a bit of working stuff. I try to work through the steps but this can't be done in one PR. SBFGameManager is already 1000 lines without doing much so it's a worthy companion to GameManager :)

I ran the tests, played a game with Princess and pulled these changes into MHQ and started a story arc fight. All seemed to work.

@HammerGS
Copy link
Member

Now has conflicts.

private int victoryTeam = Player.TEAM_NONE;

private Hashtable<Integer, Vector<Entity>> deploymentTable = new Hashtable<>();
// private Hashtable<Integer, Vector<Entity>> deploymentTable = new Hashtable<>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please clean this up.

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

One commented line, and a few codeQL notices that should be cleaned up (I believe the style guide calls out @override as being required).

Other than that, looks good - very exciting!

SJuliez added 4 commits May 16, 2024 22:44
# Conflicts:
#	megamek/src/megamek/common/strategicBattleSystems/SBFGame.java
#	megamek/src/megamek/server/SBFGameManager.java
@SJuliez
Copy link
Member Author

SJuliez commented May 16, 2024

OK cleaned up. I believe the missing overrides were in the other PR, but I corrected them. Not seeing any warnings here.

@HammerGS HammerGS merged commit 2d8b33f into MegaMek:master May 16, 2024
@SJuliez SJuliez deleted the SBF-step branch May 19, 2024 14:36
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.

3 participants