コード例 #1
0
 /// <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.
     }
 }
コード例 #2
0
 public virtual void LoadFromPrototype(BodyTemplatePrototype data)
 {
     Name        = data.Name;
     CenterSlot  = data.CenterSlot;
     Slots       = data.Slots;
     Connections = data.Connections;
 }
コード例 #3
0
        public void ChangeBodyTemplate(BodyTemplatePrototype newTemplate)
        {
            foreach (var part in Parts)
            {
                // TODO: Make this work.
            }

            OnBodyChanged();
        }
コード例 #4
0
 protected virtual void LoadFromPrototype(BodyTemplatePrototype data)
 {
     Name            = data.Name;
     CenterSlot      = data.CenterSlot;
     Slots           = data.Slots;
     Connections     = data.Connections;
     Layers          = data.Layers;
     MechanismLayers = data.MechanismLayers;
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 public BodyTemplate(BodyTemplatePrototype data)
 {
     LoadFromPrototype(data);
 }