public bool IsLocked()
 {
     if( ( locked == true )&&( Sender == null ) ){
         locked = false;
         Sender = null;
     }
     return locked;
 }
 public bool Lock(BeltSenderComponent sender)
 {
     if( ( locked )&&( Sender != sender ) )
         return false;
     locked = true;
     Sender = sender;
     return true;
 }
        public override void PostExposeData()
        {
            base.PostExposeData();

            Scribe_Values.LookValue(ref locked, "locked", false, true);

            IntVec3 pos = IntVec3.Invalid;

            if (Sender != null)
                pos = Sender.parent.Position;

            Scribe_Values.LookValue(ref pos, "sender", IntVec3.Invalid, true);

            if( ( Scribe.mode == LoadSaveMode.LoadingVars )&&
                ( pos != IntVec3.Invalid ) ){

                var sender = Manager.GetSenderAtPos( pos );

                if( sender == null ){
                    locked = false;
                    Sender = null;
                } else {
                    Sender = sender;
                }
            }
        }
 public bool Unlock(BeltSenderComponent sender)
 {
     if( ( locked )&&( Sender != sender ) )
         return false;
     Sender.Released();
     Sender = null;
     locked = false;
     return true;
 }