Class BFSFile

java.lang.Object
megamek.common.loaders.BFSFile
All Implemented Interfaces:
IMekLoader

public class BFSFile extends Object implements 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 Details

  • Method Details

    • getEntity

      public Entity getEntity()
      Specified by:
      getEntity in interface IMekLoader
      Returns:
      A valid mek, matching the file to the best of MegaMek's current capabilities
    • isBfsContent

      public static boolean isBfsContent(String content)
      Determines whether the given string is a .bfs document, 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 the assetType field that is unique to the .bfs format; no .mtf or .blk file satisfies both. The fields are not otherwise validated.
      Parameters:
      content - the unit representation to test
      Returns:
      true if the content is a .bfs YAML document