Example #1
0
 public bool TrySendBurden(Burden burden, CharacterBurdenManager target)
 {
     if (burden == null)
     {
         Debug.LogError("Tried to send a null burden. aborting");
         return(false);
     }
     //can the target receive burdens? etc.
     if (!canSendBurdens)
     {
         Debug.LogWarning(burdenInventory.ContainerName + " had a send burden request, but is not in a state they can.");
         return(false);
     }
     else
     {
         //return true if send was a success.
         return(BurdenTools.TransferBurden(burden, this, target));
     }
 }
Example #2
0
 public bool AddBurdenWorldSource(Burden burden, CharacterBurdenManager sender, CharacterBurdenManager receiver, bool overrideValidation = false)
 {
     //accessed by world sources to add a burden to the character.
     //May or may not validate prior (some systems may necessitate overrides)
     //this will commonly have a null sender, but in some cases, the sender may be an interactable object that can receive burdens and ideas.
     if (!overrideValidation)
     {
         if (BurdenTools.PrevalidateTransaction(burden, sender, receiver))
         {
             receiver.burdenInventory.IngestBurden(burden, receiver);
             return(true);
         }
         else
         {
             //prevalidation failed! validation will handle the debug logs.
             return(false);
         }
     }
     else
     {
         receiver.burdenInventory.IngestBurden(burden, receiver);
         return(true);
     }
 }