Add option to get watched players and their current equip from IPlayerWatcher.

This commit is contained in:
Ottermandias 2021-08-23 15:35:49 +02:00
parent adb1aaeb93
commit 65778bb1b4
3 changed files with 26 additions and 13 deletions

View file

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Plugin;
using Penumbra.GameData.Structs;
@ -81,6 +83,14 @@ namespace Penumbra.PlayerWatch
CheckValidity();
return _playerWatch!.UpdateActorWithoutEvent( actor );
}
public IEnumerable< (string, ActorEquipment) > WatchedPlayers()
{
CheckValidity();
return _playerWatch!.Equip
.Where( kvp => kvp.Value.Item2.Contains( this ) )
.Select( kvp => ( kvp.Key, kvp.Value.Item1 ) );
}
}
public static class PlayerWatchFactory