/// <summary> /// Changes the current <see cref="BodyTemplate"/> to the given <see cref="BodyTemplate"/>. Attempts to keep previous <see cref="BodyPart">BodyParts</see> /// if there is a slot for them in both <see cref="BodyTemplate"/>. /// </summary> public void ChangeBodyTemplate(BodyTemplatePrototype newTemplate) { foreach (KeyValuePair <string, BodyPart> part in _partDictionary) { //TODO: Make this work. } }
public virtual void LoadFromPrototype(BodyTemplatePrototype data) { Name = data.Name; CenterSlot = data.CenterSlot; Slots = data.Slots; Connections = data.Connections; }
public void ChangeBodyTemplate(BodyTemplatePrototype newTemplate) { foreach (var part in Parts) { // TODO: Make this work. } OnBodyChanged(); }
protected virtual void LoadFromPrototype(BodyTemplatePrototype data) { Name = data.Name; CenterSlot = data.CenterSlot; Slots = data.Slots; Connections = data.Connections; Layers = data.Layers; MechanismLayers = data.MechanismLayers; }
public virtual void Initialize(BodyTemplatePrototype prototype) { DebugTools.Assert(!Initialized, $"{nameof(BodyTemplate)} {Name} has already been initialized!"); Name = prototype.Name; CenterSlot = prototype.CenterSlot; Slots = new Dictionary <string, BodyPartType>(prototype.Slots); Connections = new Dictionary <string, List <string> >(prototype.Connections); Layers = new Dictionary <string, string>(prototype.Layers); MechanismLayers = new Dictionary <string, string>(prototype.MechanismLayers); Initialized = true; }
public BodyTemplate(BodyTemplatePrototype data) { LoadFromPrototype(data); }