forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 111
[Exiled::Events] [Exiled::API] New event + new property
#31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3f404c9
new ev + previous role
VALERA771 c40c52f
suggestions
VALERA771 cac9a15
uwu
VALERA771 bddd7d3
suj
VALERA771 e2f58c5
Merge remote-tracking branch 'upstream/dev' into escaped-event
VALERA771 2147c94
fix
VALERA771 8732744
uwu
VALERA771 fc059b9
Merge branch 'dev' into escaped-event
louis1706 1f2f7e2
Merge branch 'dev' into escaped-event
louis1706 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,70 @@ | ||
| // ----------------------------------------------------------------------- | ||
| // <copyright file="EscapedEventArgs.cs" company="Exiled Team"> | ||
| // Copyright (c) Exiled Team. All rights reserved. | ||
| // Licensed under the CC BY-SA 3.0 license. | ||
| // </copyright> | ||
| // ----------------------------------------------------------------------- | ||
|
|
||
| namespace Exiled.Events.EventArgs.Player | ||
| { | ||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| using Exiled.API.Enums; | ||
| using Exiled.API.Features; | ||
| using Exiled.API.Features.Roles; | ||
| using Exiled.Events.EventArgs.Interfaces; | ||
| using PlayerRoles; | ||
| using Respawning; | ||
|
|
||
| /// <summary> | ||
| /// Contains all information after player has escaped. | ||
| /// </summary> | ||
| public class EscapedEventArgs : IPlayerEvent | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="EscapedEventArgs"/> class. | ||
| /// </summary> | ||
| /// <param name="player"><inheritdoc cref="Player"/></param> | ||
| /// <param name="escapeScenario"><inheritdoc cref="EscapeScenario"/></param> | ||
| /// <param name="role"><inheritdoc cref="Role"/></param> | ||
| /// <param name="kvp"><inheritdoc cref="Tickets"/>, <inheritdoc cref="Team"/>.</param> | ||
| public EscapedEventArgs(Player player, EscapeScenario escapeScenario, Role role, KeyValuePair<SpawnableTeamType, float> kvp) | ||
| { | ||
| Player = player; | ||
| EscapeScenario = escapeScenario; | ||
| Team = kvp.Key; | ||
| Tickets = kvp.Value; | ||
| OldRole = role; | ||
| EscapeTime = (int)Math.Ceiling(role.ActiveTime.TotalSeconds); | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public Player Player { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the type of escape. | ||
| /// </summary> | ||
| public EscapeScenario EscapeScenario { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the <see cref="SpawnableTeamType"/> that gained tickets for this escape. | ||
| /// </summary> | ||
| public SpawnableTeamType Team { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the amount of tickets gained for this escape. | ||
| /// </summary> | ||
| public float Tickets { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the previous role for this player. | ||
| /// </summary> | ||
| public Role OldRole { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the time in seconds since round started. | ||
| /// </summary> | ||
| public int EscapeTime { get; } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.