Exemplo n.º 1
0
        public override void LoadAll(IO.ComponentData Compound)
        {
            base.LoadAll(Compound);

            var o = Compound.GetVector2("OrigPos");
            if (o.X == -1 && o.Y == -1)
                origPos = null;
            else
                origPos = o;

            PushedPositions.Clear();

            int i = 0;
            while (true)
            {
                if (Compound.Contains("Component" + i.ToString()))
                {
                    if (Compound.GetString("Component" + i.ToString()) == "list")
                    {
                        int j = 0;
                        List<Vector2> p = new List<Vector2>();
                        while (true)
                        {
                            if (Compound.Contains("Component" + i.ToString() + j.ToString()))
                            {
                                p.Add(Compound.GetVector2("Component" + i.ToString() + j.ToString()));
                            }
                            else
                            {
                                break;
                            }
                            j++;
                        }
                        PushedPositions.Add(p);
                    }
                    else
                    {
                        PushedPositions.Add(Compound.GetVector2("Component" + i.ToString()));
                    }
                }
                else
                {
                    break;
                }
                i++;
            }

            i = 0;
            contains.Clear();
            while (true)
            {
                if (Compound.Contains("Contains" + i.ToString()))
                {
                    contains.Add(Compound.GetInt("Contains" + i.ToString()));
                }
                else
                {
                    break;
                }
                i++;
            }

            if (origPos != null)
                ignoreNextPosSave = true;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when a scheme is being loaded
 /// </summary>
 /// <param name="Compound">Use this to read data</param>
 public virtual void LoadAll(IO.ComponentData Compound)
 {
     ID = Compound.GetInt("ID");
     Graphics.Position = Compound.GetVector2("Position");
     Graphics.Size = Compound.GetVector2("Size");
     Graphics.Visible = Compound.GetBool("Visible");
     rotation = (Rotation)Compound.GetInt("Rotation");
     isRemovable = Compound.GetBool("Removable");
 }