feat(hs): view plugin to open team-select panel
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// <copyright file="IShowHeykelSavasiTeamPanelPlugIn.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.GameLogic.Views.MiniGames;
|
||||
|
||||
/// <summary>
|
||||
/// Interface of a view whose implementation informs about the opened Heykel Savasi team-select panel.
|
||||
/// </summary>
|
||||
public interface IShowHeykelSavasiTeamPanelPlugIn : IViewPlugIn
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the Heykel Savasi team-select panel.
|
||||
/// </summary>
|
||||
/// <param name="redCount">The current number of players in the red team.</param>
|
||||
/// <param name="blueCount">The current number of players in the blue team.</param>
|
||||
ValueTask ShowTeamPanelAsync(int redCount, int blueCount);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// <copyright file="ShowHeykelSavasiTeamPanelPlugIn.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.GameServer.RemoteView.MiniGames;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using MUnique.OpenMU.GameLogic;
|
||||
using MUnique.OpenMU.GameLogic.Views.MiniGames;
|
||||
using MUnique.OpenMU.Network.Packets.ServerToClient;
|
||||
using MUnique.OpenMU.PlugIns;
|
||||
|
||||
/// <summary>
|
||||
/// The default implementation of the <see cref="IShowHeykelSavasiTeamPanelPlugIn"/> which is forwarding everything to the game client with specific data packets.
|
||||
/// </summary>
|
||||
[PlugIn]
|
||||
[Guid("bccff260-8f1c-40fe-90b2-110723e13374")]
|
||||
public class ShowHeykelSavasiTeamPanelPlugIn : IShowHeykelSavasiTeamPanelPlugIn
|
||||
{
|
||||
private readonly RemotePlayer _player;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShowHeykelSavasiTeamPanelPlugIn"/> class.
|
||||
/// </summary>
|
||||
/// <param name="player">The player.</param>
|
||||
public ShowHeykelSavasiTeamPanelPlugIn(RemotePlayer player) => this._player = player;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async ValueTask ShowTeamPanelAsync(int redCount, int blueCount)
|
||||
{
|
||||
var connection = this._player.Connection;
|
||||
if (connection is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await connection.SendHeykelSavasiOpenTeamPanelAsync((byte)redCount, (byte)blueCount).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user