private void SelectionProcess(Packet p_Packet, Player p_Player) { SelectionPacket l_Packet = (SelectionPacket)p_Packet; p_Player.Selection.Clear(); Console.WriteLine("[INFO] " + p_Player.Data.Login + " selection:"); foreach (int l_Id in l_Packet.Selection) { Entity m_Entity = Game.Instance.EntityManager.GetEntity(l_Id); Console.WriteLine(" - " + m_Entity.Id); if (p_Player.IsHostile(m_Entity.Player) == HOSTILITY.MY) { p_Player.Selection.Add(m_Entity); } } }
public void AddPacketsButtonHandler(Object obj, EventArgs e) { DateRange range = new DateRange(_fromDateTimePicker.Value, _toDateTimePicker.Value); using (SelectionPacket sp = new SelectionPacket(range)) { if (sp.ShowDialog() == DialogResult.OK) { foreach (IPacket p in sp.SelectedPackets()) { _packets.Add(p); _packetListView.Items.Add(p.InformationString); } _clearButton.Enabled = true; } else { return; } } }