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

Write BotForce entities to XML with EntityListFile #3906

Merged

Conversation

AaronGullickson
Copy link
Member

This PR changes the XML writer to EntityListFile.WriteEntityList. Currently that method is private so this PR should only be merged after MegaMek/megamek#5282 which makes it public and accessible.

Currently BotForce entities are written using the MHQXML writer. However, this writer is not up to date and misses important information like a lot of the deployment variables, as well as any assigned pilot portraits. From the notes on this method, it seems like there is a push to move all of this over to EntityListfile.WriteEntityList which is up to date. I need an XML writer that is up to date because the Story Arcs PR #2997 uses all kinds of entity information to set up better scenarios, particularly deployment information.

@AaronGullickson AaronGullickson self-assigned this Mar 25, 2024
MHQXMLUtility.writeEntityWithCrewToXML(pw, indent, en, getFixedEntityListDirect());
}
try {
EntityListFile.writeEntityList(pw, (ArrayList<Entity>) getFixedEntityListDirect());

Check warning

Code scanning / CodeQL

Cast from abstract to concrete collection Warning

List
is cast to the concrete type
ArrayList
, losing abstraction.
@AaronGullickson AaronGullickson merged commit 0a2b4e4 into MegaMek:master Mar 26, 2024
4 checks passed
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.

2 participants