setName() public method

public setName ( string name ) : void
name string
return void
Beispiel #1
0
    /*!
    \brief This function create a new Medium based on the information in the given XML Node
    \param node The XmlNode to load.
    \return Return the new Medium
      */
    public Medium loadMedium(XmlNode node)
    {
        Medium medium = new Medium();

        foreach (XmlNode attr in node)
          {
        switch (attr.Name)
          {
          case "Id":
            medium.setId(Convert.ToInt32(attr.InnerText));
            break;
          case "Name":
            medium.setName(attr.InnerText);
            break;
          case "Energy":
            loadEnergy(attr.InnerText, medium);
            break;
          case "EnergyProductionRate":
            loadEnergyProductionRate(attr.InnerText, medium);
            break;
          case "MaxEnergy":
            loadMaxEnergy(attr.InnerText, medium);
            break;
          case "ReactionsSet":
            medium.setReactionsSet(attr.InnerText);
            break;
          case "MoleculesSet":
            medium.setMoleculesSet(attr.InnerText);
            break;
          }
          }
        return medium;
    }