mirror of
https://github.com/MSWS/TTT.git
synced 2025-12-05 22:20:25 -08:00
fix: Re-add moved files
This commit is contained in:
25
TTT/SpecialRoundAPI/AbstractSpecialRound.cs
Normal file
25
TTT/SpecialRoundAPI/AbstractSpecialRound.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SpecialRoundAPI.Configs;
|
||||
using TTT.API.Events;
|
||||
using TTT.Game.Events.Game;
|
||||
using TTT.Game.Listeners;
|
||||
using TTT.Locale;
|
||||
|
||||
namespace SpecialRoundAPI;
|
||||
|
||||
public abstract class AbstractSpecialRound(IServiceProvider provider)
|
||||
: BaseListener(provider) {
|
||||
protected readonly ISpecialRoundTracker Tracker =
|
||||
provider.GetRequiredService<ISpecialRoundTracker>();
|
||||
|
||||
public abstract string Name { get; }
|
||||
public abstract IMsg Description { get; }
|
||||
public abstract SpecialRoundConfig Config { get; }
|
||||
|
||||
public abstract void ApplyRoundEffects();
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public abstract void OnGameState(GameStateUpdateEvent ev);
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/BhopRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/BhopRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record BhopRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.25f;
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/PistolRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/PistolRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record PistolRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.75f;
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/SilentRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/SilentRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SilentRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.5f;
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/SpecialRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/SpecialRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public abstract record SpecialRoundConfig {
|
||||
public abstract float Weight { get; init; }
|
||||
}
|
||||
9
TTT/SpecialRoundAPI/Configs/SpeedRoundConfig.cs
Normal file
9
TTT/SpecialRoundAPI/Configs/SpeedRoundConfig.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SpeedRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 1;
|
||||
|
||||
public TimeSpan InitialSeconds { get; init; } = TimeSpan.FromSeconds(40);
|
||||
public TimeSpan SecondsPerKill { get; init; } = TimeSpan.FromSeconds(8);
|
||||
public TimeSpan MaxTimeEver { get; init; } = TimeSpan.FromSeconds(90);
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/SuppressedRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/SuppressedRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SuppressedRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.75f;
|
||||
}
|
||||
5
TTT/SpecialRoundAPI/Configs/VanillaRoundConfig.cs
Normal file
5
TTT/SpecialRoundAPI/Configs/VanillaRoundConfig.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record VanillaRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.5f;
|
||||
}
|
||||
13
TTT/SpecialRoundAPI/ISpecialRoundStarter.cs
Normal file
13
TTT/SpecialRoundAPI/ISpecialRoundStarter.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace SpecialRoundAPI;
|
||||
|
||||
public interface ISpecialRoundStarter {
|
||||
/// <summary>
|
||||
/// Attempts to start the given special round.
|
||||
/// Will bypass most checks, but may still return null if starting the round
|
||||
/// is not possible.
|
||||
/// </summary>
|
||||
/// <param name="round"></param>
|
||||
/// <returns></returns>
|
||||
public AbstractSpecialRound?
|
||||
TryStartSpecialRound(AbstractSpecialRound? round);
|
||||
}
|
||||
6
TTT/SpecialRoundAPI/ISpecialRoundTracker.cs
Normal file
6
TTT/SpecialRoundAPI/ISpecialRoundTracker.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace SpecialRoundAPI;
|
||||
|
||||
public interface ISpecialRoundTracker {
|
||||
public AbstractSpecialRound? CurrentRound { get; set; }
|
||||
public int RoundsSinceLastSpecial { get; set; }
|
||||
}
|
||||
15
TTT/SpecialRoundAPI/SpecialRoundAPI.csproj
Normal file
15
TTT/SpecialRoundAPI/SpecialRoundAPI.csproj
Normal file
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Locale\Locale.csproj"/>
|
||||
<ProjectReference Include="..\..\TTT\API\API.csproj"/>
|
||||
<ProjectReference Include="..\..\TTT\Game\Game.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user