コード例 #1
0
 public void RemoveItemFromInventory(IPickable pickable)
 {
     foreach (Node child in GetChildren())
     {
         if (pickable.GetType().Name == child.GetType().Name&& !child.IsQueuedForDeletion())
         {
             child.QueueFree();
         }
     }
 }
コード例 #2
0
 public int GetAlignmentChange(IPickable change)
 {
     if (change != null)
     {
         if (change.GetType() == typeof(Weapon))
         {
             return(((Weapon)change).alignment - (weapon != null ? weapon.alignment : 0));
         }
         else if (change.GetType() == typeof(SecondaryWeapon))
         {
             return(((SecondaryWeapon)change).alignment - (secondaryWeapon != null ? secondaryWeapon.alignment : 0));
         }
         else if (change.GetType() == typeof(Passive))
         {
             return(((Passive)change).alignment - (passive != null ? passive.alignment : 0));
         }
     }
     return(0);
 }