private void GearInv_SlotModified(int t1) { ITreeAttribute tree = new TreeAttribute(); WatchedAttributes["inventory"] = tree; gearInv.ToTreeAttributes(tree); WatchedAttributes.MarkPathDirty("inventory"); }
/// <summary> /// Attempts to mount the player on a target. /// </summary> /// <param name="onmount">The mount to mount</param> /// <returns>Whether it was mounted or not.</returns> public bool TryMount(IMountable onmount) { if (MountedOn != onmount) { if (!TryUnmount()) { return(false); } } TreeAttribute mountableTree = new TreeAttribute(); onmount?.MountableToTreeAttributes(mountableTree); WatchedAttributes["mountedOn"] = mountableTree; WatchedAttributes.MarkPathDirty("mountedOn"); // -> this calls updateMountedState() return(true); }