//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("C1", ConnectedComponent1.ID); Compound.Add("C2", ConnectedComponent2.ID); }
public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("OrigPos", Settings.GameState == Settings.GameStates.Stopped ? new Vector2(-1, -1) : origPos.Value); for (int i = 0; i < PushedPositions.Count; i++) { if (PushedPositions[i] is Vector2) { Compound.Add("Component" + i.ToString(), (Vector2)PushedPositions[i]); } if (PushedPositions[i] is List <Vector2> ) { Compound.Add("Component" + i.ToString(), "list"); List <Vector2> t = (List <Vector2>)PushedPositions[i]; for (int j = 0; j < t.Count; j++) { Compound.Add("Component" + i.ToString() + j.ToString(), (Vector2)t[j]); } } } for (int i = 0; i < components.Count; i++) { Compound.Add("Contains" + i.ToString(), components[i].ID); } }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); Compound.Add("RequiredLength", (Logics as Logics.PulseCoreLogics).RequiredActivity); }
//================================================================IO=========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J1", J1.ID); Compound.Add("J2", J2.ID); Compound.Add("Resistance", Resistance); Compound.Add("IsConnected", IsConnected); Compound.Add("Direction", direction.GetHashCode()); Compound.Add("SendingVoltage", sendingVoltage); Compound.Add("SendingCurrent", sendingCurrent); Compound.Add("CanSendVoltage", CanSendVoltageOrCurrent); if (Graphics.Visible) { String d = ""; var g = Graphics as Graphics.WireGraphics; for (int i = 0; i < g.DrawPath.Count; i++) { d += g.DrawPath[i].X.ToString() + ";" + g.DrawPath[i].Y.ToString() + ";"; } d = d.Substring(0, d.Length - 1); Compound.Add("DrawPath", d); } }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); Compound.Add("Voltage", (Logics as Logics.PowerACLogics).voltage); Compound.Add("Period", (Logics as Logics.PowerACLogics).period); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); for (int i = 0; i < Joints.Length; i++) { Compound.Add("J" + i.ToString(), Joints[i].ID); } for (int i = 0; i < W.Length; i++) { Compound.Add("W" + i.ToString(), W[i].ID); } }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("J4", Joints[4].ID); Compound.Add("J5", Joints[5].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("W3", W3.ID); Compound.Add("Period", (Logics as Logics.SignalSplitterLogics).Period); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); for (int i = 0; i < Joints.Length; i++) { Compound.Add("J" + i.ToString(), Joints[i].ID); } for (int i = 0; i < Wires.Length; i++) { Compound.Add("W" + i.ToString(), Wires[i].ID); } Compound.Add("Swapped", Swapped); Compound.Add("OrigSwapped", OrigSwapped); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); String s = ""; var l = Logics as Logics.CoreLogics; for (int i = 0; i < l.target.Length; i++) { s += l.target[i] ? "1" : "0"; } Compound.Add("Target", s); Compound.Add("Accuracy", (Logics as Logics.CoreLogics).RequiredAccuracy); }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("J4", Joints[4].ID); Compound.Add("J5", Joints[5].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("W3", W3.ID); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("Charge", (Logics as Logics.AccumulatorLogics).Charge); Compound.Add("StartCharge", (Logics as Logics.AccumulatorLogics).StartCharge); Compound.Add("MaxCharge", (Logics as Logics.AccumulatorLogics).MaxCharge); }
//=============================================================ID============================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); String s = ""; for (int i = 0; i < ConnectedWires.Count; i++) { s += ConnectedWires[i].ID + ";"; } if (s.Length > 0) { s = s.Substring(0, s.Length - 1); } Compound.Add("ConnectedWires", s); Compound.Add("CanGround", CanBeGround); Compound.Add("CanPower", CanProvidePower); Compound.Add("IsGround", isGround); Compound.Add("IsPower", isProvidingPower); Compound.Add("SendingVoltage", SendingVoltage); Compound.Add("SendingCurrent", SendingCurrent); /* * s = ""; * for (int i = 0; i < ContainingComponents.Count; i++) * { * s += ContainingComponents[i].ID.ToString() + ";"; * } * if (s.Length > 0) * s = s.Substring(0, s.Length - 1); * Compound.Add("ContainingComponents", s);//*/ }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("W3", W3.ID); Compound.Add("Capacitance", (Logics as Logics.CapacitorLogics).Capacitance); Compound.Add("MaxVoltage", (Logics as Logics.CapacitorLogics).MaxOutputVoltage); }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("Delay", (Logics as Logics.DelayerLogics).Delay); }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("J3", Joints[3].ID); Compound.Add("Current", MaxCurrent); Compound.Add("Potential", MaxVoltage); Compound.Add("Force", MaxMagnetForce); }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); for (int i = 0; i < Joints.Length; i++) { Compound.Add("J" + i.ToString(), Joints[i].ID); } Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("W3", W3.ID); Compound.Add("W4", W4.ID); var l = Logics as Logics.TeslaCoilLogics; Compound.Add("DischargeVoltage", l.DischargeVoltage); Compound.Add("Capacitance", l.Capacitance); Compound.Add("Range", l.Range); Compound.Add("Charge", l.CurCharge); }
/// <summary> /// Called when a scheme is being saved /// </summary> /// <param name="Compound">Use this to save data</param> public virtual void SaveAll(IO.ComponentData Compound) { Compound.SetType(GetType()); Compound.Add("ID", ID); Compound.Add("Position", Graphics.Position); Compound.Add("Size", Graphics.Size); Compound.Add("Visible", Graphics.Visible); Compound.Add("Rotation", rotation.GetHashCode()); Compound.Add("Removable", isRemovable); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); Compound.Add("Min", (Logics as Logics.VoltageGraphLogics).min); Compound.Add("Max", (Logics as Logics.VoltageGraphLogics).max); Compound.Add("Frequency", (Logics as Logics.VoltageGraphLogics).frequency); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("J2", Joints[2].ID); Compound.Add("W1", W1.ID); Compound.Add("W2", W2.ID); Compound.Add("Connection", connection.GetHashCode()); }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); Compound.Add("Resistance", Resistance); if (connectedComponent == null) { Compound.Add("ConComp", -1); Compound.Add("Connector", -1); } else { Compound.Add("ConComp", connectedComponent.ID); Compound.Add("Connector", connector.ID); } }
//============================================================LOGICS======================================================== //==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); for (int i = 0; i < Joints.Length; i++) { Compound.Add("J" + i.ToString(), Joints[i].ID); } for (int i = 0; i < Wires.Length; i++) { Compound.Add("W" + i.ToString(), Wires[i].ID); } Compound.Add("Left", left.GetHashCode()); Compound.Add("Up", up.GetHashCode()); Compound.Add("Right", right.GetHashCode()); Compound.Add("Down", down.GetHashCode()); Compound.Add("Range", Range); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("Field", fieldRadius); Compound.Add("Pole", pole.GetHashCode()); if (connectedComponent == null) { Compound.Add("ConComp", -1); Compound.Add("Connector", -1); } else { Compound.Add("ConComp", connectedComponent.ID); Compound.Add("Connector", connector.ID); } }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); Compound.Add("J0", Joints[0].ID); Compound.Add("J1", Joints[1].ID); Compound.Add("W", W.ID); Compound.Add("Cycle", (Logics as Logics.PulseFormerLogics).cycle); String s = ""; float[] t = (Logics as Logics.PulseFormerLogics).pulses; for (int i = 0; i < t.Length; i++) { s += t[i].ToString() + ";"; } s = s.Substring(0, s.Length - 1); Compound.Add("Pulses", s); Compound.Add("MaxRes", MaxResistance); }
//==============================================================IO========================================================== public override void SaveAll(IO.ComponentData Compound) { base.SaveAll(Compound); for (int i = 0; i < Joints.Length; i++) { Compound.Add("J" + i.ToString(), Joints[i].ID); } for (int i = 0; i < Wires.Length; i++) { Compound.Add("W" + i.ToString(), Wires[i].ID); } Compound.Add("Left", connectedLeft); Compound.Add("Up", connectedUp); Compound.Add("Right", connectedRight); Compound.Add("Down", connectedDown); Compound.Add("LeftUp", leftUp); Compound.Add("LeftRight", leftRight); Compound.Add("LeftDown", leftDown); Compound.Add("UpRight", upRight); Compound.Add("UpDown", upDown); Compound.Add("RightDown", RightDown); Compound.Add("PortLeft", left.GetHashCode()); Compound.Add("PortUp", up.GetHashCode()); Compound.Add("PortRight", right.GetHashCode()); Compound.Add("PortDown", down.GetHashCode()); }