-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathGameDataEventArgs.cs
More file actions
46 lines (40 loc) · 1.1 KB
/
GameDataEventArgs.cs
File metadata and controls
46 lines (40 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Text;
using Waher.Networking.MQTT;
namespace Waher.Networking.PeerToPeer
{
/// <summary>
/// Event arguments for game data events.
/// </summary>
public class GameDataEventArgs : EventArgs
{
private readonly Player fromPlayer;
private readonly PeerConnection connection;
private readonly byte[] packet;
private readonly BinaryInput data;
internal GameDataEventArgs(Player FromPlayer, PeerConnection Connection, byte[] Packet)
{
this.fromPlayer = FromPlayer;
this.connection = Connection;
this.packet = Packet;
this.data = new BinaryInput(Packet);
}
/// <summary>
/// Game data received from this player.
/// </summary>
public Player FromPlayer => this.fromPlayer;
/// <summary>
/// Game data received over this connection.
/// </summary>
public PeerConnection Connection => this.connection;
/// <summary>
/// Binary game data packet received.
/// </summary>
public byte[] Packet => this.packet;
/// <summary>
/// Game data received.
/// </summary>
public BinaryInput Data => this.data;
}
}