forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new ev + previous role * suggestions * uwu * suj * fix * uwu --------- Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
136 additions
and
7 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 |
---|---|---|
@@ -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 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