forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathL2Radar.cs
More file actions
46 lines (38 loc) · 1.43 KB
/
Copy pathL2Radar.cs
File metadata and controls
46 lines (38 loc) · 1.43 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.Collections.Generic;
using L2dotNET.Network.serverpackets;
namespace L2dotNET.Models.Player.General
{
public class L2Radar
{
private readonly L2Player _player;
private readonly List<RadarMarker> _markers;
public L2Radar(L2Player player)
{
_player = player;
_markers = new List<RadarMarker>();
}
public void AddMarker(int x, int y, int z)
{
RadarMarker newMarker = new RadarMarker(x, y, z);
_markers.Add(newMarker);
_player.SendPacketAsync(new RadarControl(2, 2, x, y, z));
_player.SendPacketAsync(new RadarControl(0, 1, x, y, z));
}
public void RemoveMarker(int x, int y, int z)
{
RadarMarker newMarker = new RadarMarker(x, y, z);
_markers.Remove(newMarker);
_player.SendPacketAsync(new RadarControl(1, 1, x, y, z));
}
public void RemoveAllMarkers()
{
_markers.ForEach(tempMarker => _player.SendPacketAsync(new RadarControl(2, 2, tempMarker._x, tempMarker._y, tempMarker._z)));
_markers.Clear();
}
public void loadMarkers()
{
_player.SendPacketAsync(new RadarControl(2, 2, _player.X, _player.Y, _player.Z));
_markers.ForEach(tempMarker => _player.SendPacketAsync(new RadarControl(0, 1, tempMarker._x, tempMarker._y, tempMarker._z)));
}
}
}