Package megamek.common.loaders
Class BFSFile
java.lang.Object
megamek.common.loaders.BFSFile
- All Implemented Interfaces:
IMekLoader
Loads a Battlefield Support Asset from a
.bfs YAML file, producing a BattlefieldSupportAsset entity.
The file is parsed into a BattlefieldSupportAssetData stat block, which the entity is then built from.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisBfsContent(String content) Determines whether the given string is a.bfsdocument, used to route in-memory unit strings (for example the undo/redo mementos) that carry no filename.
-
Constructor Details
-
BFSFile
- Throws:
EntityLoadingException
-
-
Method Details
-
getEntity
- Specified by:
getEntityin interfaceIMekLoader- Returns:
- A valid mek, matching the file to the best of MegaMek's current capabilities
-
isBfsContent
Determines whether the given string is a.bfsdocument, used to route in-memory unit strings (for example the undo/redo mementos) that carry no filename. The content must parse as YAML and carry theassetTypefield that is unique to the.bfsformat; no.mtfor.blkfile satisfies both. The fields are not otherwise validated.- Parameters:
content- the unit representation to test- Returns:
trueif the content is a.bfsYAML document
-