2019-11-21 17:24:19 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Content.Shared.Interfaces.Chemistry;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
2019-07-31 05:10:06 -07:00
|
|
|
|
using Robust.Shared.Prototypes;
|
2019-11-21 17:24:19 -05:00
|
|
|
|
using Robust.Shared.Serialization;
|
2019-07-31 05:10:06 -07:00
|
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Chemistry
|
|
|
|
|
|
{
|
|
|
|
|
|
[Prototype("reagent")]
|
|
|
|
|
|
public class ReagentPrototype : IPrototype, IIndexedPrototype
|
|
|
|
|
|
{
|
2019-11-21 17:24:19 -05:00
|
|
|
|
private string _id;
|
|
|
|
|
|
private string _name;
|
|
|
|
|
|
private string _description;
|
|
|
|
|
|
private Color _substanceColor;
|
|
|
|
|
|
private List<IMetabolizable> _metabolism;
|
|
|
|
|
|
|
|
|
|
|
|
public string ID => _id;
|
|
|
|
|
|
public string Name => _name;
|
|
|
|
|
|
public string Description => _description;
|
|
|
|
|
|
public Color SubstanceColor => _substanceColor;
|
|
|
|
|
|
//List of metabolism effects this reagent has, should really only be used server-side.
|
|
|
|
|
|
public List<IMetabolizable> Metabolism => _metabolism;
|
2019-07-31 05:10:06 -07:00
|
|
|
|
|
|
|
|
|
|
public void LoadFrom(YamlMappingNode mapping)
|
|
|
|
|
|
{
|
2019-11-21 17:24:19 -05:00
|
|
|
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
2019-07-31 05:10:06 -07:00
|
|
|
|
|
2019-11-21 17:24:19 -05:00
|
|
|
|
serializer.DataField(ref _id, "id", string.Empty);
|
|
|
|
|
|
serializer.DataField(ref _name, "name", string.Empty);
|
|
|
|
|
|
serializer.DataField(ref _description, "desc", string.Empty);
|
|
|
|
|
|
serializer.DataField(ref _substanceColor, "color", Color.White);
|
|
|
|
|
|
serializer.DataField(ref _metabolism, "metabolism", new List<IMetabolizable>{new DefaultMetabolizable()});
|
2019-07-31 05:10:06 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|