def run(mcd, indent = '  '):
  i = indent
  prtcle_hdr = [
    "/*",
    f"{i}This file was generated by mcd2cpp.py",
    f"{i}It should not be edited by hand.",
    "*/",
    "",
    f"// For MCD version {mcd.version['minecraftVersion']}",
    "#ifndef PARTICLETYPES_HPP",
    "#define PARTICLETYPES_HPP",
    "",
    "namespace mcd {",
    "",
    "enum particle_type {"
  ]
  prtcle_hdr.extend(f"{indent}PARTICLE_{x.upper()}," for x in
      mcd.particles_name)
  prtcle_hdr[-1] = prtcle_hdr[-1][:-1]
  prtcle_hdr += ["};", "}", "#endif", ""]

  with open(f"particletypes.hpp", "w") as f:
    f.write('\n'.join(prtcle_hdr))
