mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 12:27:26 +08:00
remove CreateAPIRelationFromAPIUser
This commit is contained in:
parent
fbe6077ec2
commit
1a92e5ad19
@ -155,7 +155,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
var api = (DummyAPIAccess)API;
|
||||
|
||||
api.Friends.Clear();
|
||||
api.Friends.Add(CreateAPIRelationFromAPIUser(friend));
|
||||
api.Friends.Add(new APIRelation
|
||||
{
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetID = friend.OnlineID,
|
||||
TargetUser = friend
|
||||
});
|
||||
});
|
||||
|
||||
int playerNumber = 1;
|
||||
|
@ -30,7 +30,12 @@ namespace osu.Game.Tests.Visual.Online
|
||||
if (supportLevel > 3)
|
||||
supportLevel = 0;
|
||||
|
||||
((DummyAPIAccess)API).Friends.Add(CreateAPIRelationFromAPIUser(new APIUser
|
||||
((DummyAPIAccess)API).Friends.Add(new APIRelation
|
||||
{
|
||||
TargetID = 2,
|
||||
RelationType = RelationType.Friend,
|
||||
Mutual = true,
|
||||
TargetUser = new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
@ -38,7 +43,8 @@ namespace osu.Game.Tests.Visual.Online
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
IsSupporter = supportLevel > 0,
|
||||
SupportLevel = supportLevel
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,13 @@ namespace osu.Game.Tests.Visual.Online
|
||||
if (req.TargetId != nonFriend.OnlineID)
|
||||
return false;
|
||||
|
||||
var apiRelation = CreateAPIRelationFromAPIUser(nonFriend);
|
||||
var apiRelation = new APIRelation
|
||||
{
|
||||
TargetID = nonFriend.OnlineID,
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetUser = nonFriend
|
||||
};
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
@ -465,8 +471,13 @@ namespace osu.Game.Tests.Visual.Online
|
||||
if (req.TargetId != nonFriend.OnlineID)
|
||||
return false;
|
||||
|
||||
var apiRelation = CreateAPIRelationFromAPIUser(nonFriend);
|
||||
apiRelation.Mutual = false;
|
||||
var apiRelation = new APIRelation
|
||||
{
|
||||
TargetID = nonFriend.OnlineID,
|
||||
Mutual = false,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetUser = nonFriend
|
||||
};
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
@ -317,15 +317,6 @@ namespace osu.Game.Tests.Visual
|
||||
return result;
|
||||
}
|
||||
|
||||
public static APIRelation CreateAPIRelationFromAPIUser(APIUser user) =>
|
||||
new APIRelation
|
||||
{
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetID = user.OnlineID,
|
||||
TargetUser = user
|
||||
};
|
||||
|
||||
protected WorkingBeatmap CreateWorkingBeatmap(RulesetInfo ruleset) =>
|
||||
CreateWorkingBeatmap(CreateBeatmap(ruleset));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user