Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/Source/Characters/Jobs/SkillPrefab.cs
T
Joonas Rikkonen 8e556f1c76 - Renamed a bunch of ObjectProperty-related stuff (ObjectProperty -> SerializableProperty, IPropertyObject -> ISerializableEntity, the "SerializableProperty" attribute -> Serialize).
- Rectangle serialization.
- Option to restrict numeric properties to a range of values.
- WIP generic ISerializableEntity editor.
2017-11-08 21:15:03 +02:00

48 lines
1.0 KiB
C#

using Microsoft.Xna.Framework;
using System.Xml.Linq;
namespace Barotrauma
{
class SkillPrefab
{
private string name;
private string description;
private Vector2 levelRange;
public string Name
{
get { return name; }
}
public string Description
{
get { return description; }
}
public Vector2 LevelRange
{
get { return levelRange; }
}
public SkillPrefab(XElement element)
{
name = element.GetAttributeString("name", "");
var levelString = element.GetAttributeString("level", "");
if (levelString.Contains(","))
{
levelRange = XMLExtensions.ParseVector2(levelString, false);
}
else
{
float skillLevel = float.Parse(levelString, System.Globalization.CultureInfo.InvariantCulture);
levelRange = new Vector2(skillLevel, skillLevel);
}
}
}
}