static readonly double droop = 10; // cable sag, multiplied x gravity vector, manipulated by stretch #region Constructor public Cable() { MyAPIGateway.Utilities.ShowNotification("cable init"); MyLog.Default.WriteLine("cable constructor"); Random rand = new Random(); cableID = rand.Next(); storage = new CableStorage(cableID); drawer = new BezierDrawer(color); // TODO these should be static methods CableSession.Instance.registerCable(this); }
public Cable(CableStorage storage) { MyAPIGateway.Utilities.ShowNotification("cable init"); MyLog.Default.WriteLine("cable constructor from storage"); cableID = storage.cableId; this.storage = new CableStorage(storage.cableId, storage.parentPortId, storage.childPortId); drawer = new BezierDrawer(color); // TODO these should be static methods bool a = trySetPortsFromStorage(); if (!a) { isOrphan = true; } CableSession.Instance.registerCable(this); }