Merge pull request #319 from LukasKastern/master

Added SteamFriends.GetFriendsWithFlag
This commit is contained in:
Garry Newman 2019-11-11 08:56:06 +00:00 committed by GitHub
commit f1fdf29124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -580,12 +580,12 @@ namespace Steamworks
LookingToPlay = 6,
Invisible = 7,
Max = 8,
}
}
//
// EFriendFlags
//
internal enum FriendFlags : int
public enum FriendFlags : int
{
None = 0,
Blocked = 1,
@ -600,7 +600,7 @@ namespace Steamworks
ChatMember = 4096,
All = 65535,
}
//
// EUserRestriction
//

View File

@ -111,21 +111,23 @@ namespace Steamworks
OnChatMessage( friend, typeName, message );
}
}
public static IEnumerable<Friend> GetFriendsWithFlag(FriendFlags flag)
{
for ( int i=0; i<Internal.GetFriendCount( (int)flag); i++ )
{
yield return new Friend( Internal.GetFriendByIndex( i, (int)flag ) );
}
}
public static IEnumerable<Friend> GetFriends()
{
for ( int i=0; i<Internal.GetFriendCount( (int) FriendFlags.Immediate ); i++ )
{
yield return new Friend( Internal.GetFriendByIndex( i, (int)FriendFlags.Immediate ) );
}
return GetFriendsWithFlag(FriendFlags.Immediate);
}
public static IEnumerable<Friend> GetBlocked()
{
for ( int i = 0; i < Internal.GetFriendCount( (int)FriendFlags.Blocked ); i++ )
{
yield return new Friend( Internal.GetFriendByIndex( i, (int)FriendFlags.Blocked) );
}
return GetFriendsWithFlag(FriendFlags.Blocked);
}
public static IEnumerable<Friend> GetPlayedWith()

View File

@ -65,6 +65,7 @@ public static class Cleanup
internal static string Expose( string name )
{
if ( name == "FriendState" ) return "public";
if (name == "FriendFlags") return "public";
if ( name == "MusicStatus" ) return "public";
if ( name == "ParentalFeature" ) return "public";
if ( name == "AuthResponse" ) return "public";