This repository has been archived by the owner on Oct 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
1,759 additions
and
1,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
using Deathmatch.API.Players; | ||
using Cysharp.Threading.Tasks; | ||
using Deathmatch.API.Players; | ||
using OpenMod.API.Permissions; | ||
using System.Threading.Tasks; | ||
|
||
namespace Deathmatch.API.Loadouts | ||
{ | ||
public interface ILoadout | ||
{ | ||
string Title { get; } | ||
|
||
string? Permission { get; } | ||
UniTask GiveToPlayer(IGamePlayer player); | ||
|
||
void GiveToPlayer(IGamePlayer player); | ||
Task<bool> IsPermitted(IPermissionActor actor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
using Deathmatch.API.Players; | ||
using OpenMod.API.Ioc; | ||
using System.Threading.Tasks; | ||
|
||
namespace Deathmatch.API.Loadouts | ||
{ | ||
[Service] | ||
public interface ILoadoutSelector | ||
{ | ||
ILoadout? GetLoadout(IGamePlayer player, string category); | ||
Task SetLoadout(IGamePlayer player, string category, string loadout); | ||
ILoadout? GetSelectedLoadout(IGamePlayer player, ILoadoutCategory category); | ||
|
||
void SetSelectedLoadout(IGamePlayer player, ILoadoutCategory category, ILoadout loadout); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using Deathmatch.API.Players; | ||
using OpenMod.Unturned.Players; | ||
using OpenMod.Unturned.Users; | ||
using SDG.Unturned; | ||
using Steamworks; | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Deathmatch.API.Matches | ||
{ | ||
public static class MatchExecutorExtensions | ||
{ | ||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, Predicate<IGamePlayer> predicate) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => predicate(x)); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, ulong steamId) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x.SteamId.m_SteamID == steamId); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, CSteamID steamId) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x.SteamId == steamId); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, Player player) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x.Player == player); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, UnturnedPlayer player) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x.SteamId == player.SteamId); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, UnturnedUser user) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x.SteamId == user.SteamId); | ||
} | ||
|
||
public static IGamePlayer? GetParticipant(this IMatchExecutor matchExecutor, IGamePlayer player) | ||
{ | ||
return matchExecutor.GetParticipants().FirstOrDefault(x => x == player); | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, ulong steamId) | ||
{ | ||
return matchExecutor.GetParticipant(steamId) != null; | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, CSteamID steamId) | ||
{ | ||
return matchExecutor.GetParticipant(steamId) != null; | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, Player player) | ||
{ | ||
return matchExecutor.GetParticipant(player) != null; | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, UnturnedPlayer player) | ||
{ | ||
return matchExecutor.GetParticipant(player) != null; | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, UnturnedUser user) | ||
{ | ||
return matchExecutor.GetParticipant(user) != null; | ||
} | ||
|
||
public static bool IsParticipant(this IMatchExecutor matchExecutor, IGamePlayer player) | ||
{ | ||
return matchExecutor.GetParticipant(player) != null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...ches/Extensions/MatchManagerExtensions.cs → ...tch.API/Matches/MatchManagerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.