forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into MoveNetworkIdentity
- Loading branch information
Showing
141 changed files
with
2,450 additions
and
1,093 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
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,35 @@ | ||
## Description | ||
**Describe the changes** | ||
|
||
|
||
**What is the current behavior?** (You can also link to an open issue here) | ||
|
||
|
||
**What is the new behavior?** (if this is a feature change) | ||
|
||
|
||
**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) | ||
|
||
|
||
**Other information**: | ||
|
||
<br /> | ||
|
||
## Types of changes | ||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> | ||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to change) | ||
- [ ] Documentations | ||
<br /> | ||
|
||
## Submission checklist | ||
<!--- Put an `x` in all the boxes that apply: --> | ||
- [ ] I have checked the project can be compiled | ||
- [ ] I have tested my changes and it worked as expected | ||
|
||
### Patches (if there are any changes related to Harmony patches) | ||
- [ ] I have checked no IL patching errors in the console | ||
|
||
### Other | ||
- [ ] Still requires more testing |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="HazardType.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Enums | ||
{ | ||
using Exiled.API.Features.Hazards; | ||
|
||
/// <summary> | ||
/// Unique identifier for a <see cref="Hazard"/>. | ||
/// </summary> | ||
public enum HazardType | ||
{ | ||
/// <summary> | ||
/// SCP-939 amnestic cloud. | ||
/// </summary> | ||
AmnesticCloud, | ||
|
||
/// <summary> | ||
/// Sinkhole spawned at start of round. | ||
/// </summary> | ||
Sinkhole, | ||
|
||
/// <summary> | ||
/// SCP-173 tantrum. | ||
/// </summary> | ||
Tantrum, | ||
|
||
/// <summary> | ||
/// Should never happen | ||
/// </summary> | ||
Unknown, | ||
} | ||
} |
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,30 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="UncuffReason.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Enums | ||
{ | ||
/// <summary> | ||
/// Reasons that player gets uncuffed. | ||
/// </summary> | ||
public enum UncuffReason | ||
{ | ||
/// <summary> | ||
/// Uncuffed by a player. | ||
/// </summary> | ||
Player, | ||
|
||
/// <summary> | ||
/// Uncuffed due to the distance between cuffer and target. | ||
/// </summary> | ||
OutOfRange, | ||
|
||
/// <summary> | ||
/// Uncuffed due to the cuffer no longer alive. | ||
/// </summary> | ||
CufferDied, | ||
} | ||
} |
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,63 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="BitwiseExtensions.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Extensions | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Extensions for bitwise operations. | ||
/// </summary> | ||
public static class BitwiseExtensions | ||
{ | ||
/// <summary> | ||
/// Adds the specified flags to the given enum value. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the enum.</typeparam> | ||
/// <param name="flags">The enum value to add flags to.</param> | ||
/// <param name="newFlags">The flags to add.</param> | ||
/// <returns>The enum value with the specified flags added.</returns> | ||
public static T AddFlags<T>(this T flags, params T[] newFlags) | ||
where T : Enum => flags.ModifyFlags(true, newFlags); | ||
|
||
/// <summary> | ||
/// Removes the specified flags from the given enum value. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the enum.</typeparam> | ||
/// <param name="flags">The enum value to remove flags from.</param> | ||
/// <param name="oldFlags">The flags to remove.</param> | ||
/// <returns>The enum value with the specified flags removed.</returns> | ||
public static T RemoveFlags<T>(this T flags, params T[] oldFlags) | ||
where T : Enum => flags.ModifyFlags(false, oldFlags); | ||
|
||
/// <summary> | ||
/// Sets the specified flag to the given value, default is true. | ||
/// </summary> | ||
/// <param name="flags">The flags enum to modify.</param> | ||
/// <param name="value">The value to set the flag to.</param> | ||
/// <param name="changeFlags">The flags to modify.</param> | ||
/// <typeparam name="T">The type of the enum.</typeparam> | ||
/// <returns>The flags enum with the flag set to the given value.</returns> | ||
public static T ModifyFlags<T>(this T flags, bool value, params T[] changeFlags) | ||
where T : Enum | ||
{ | ||
long currentValue = Convert.ToInt64(flags); | ||
|
||
foreach (T flag in changeFlags) | ||
{ | ||
long flagValue = Convert.ToInt64(flag); | ||
|
||
if (value) | ||
currentValue |= flagValue; | ||
else | ||
currentValue &= ~flagValue; | ||
} | ||
|
||
return (T)Enum.ToObject(typeof(T), currentValue); | ||
} | ||
} | ||
} |
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.