// Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3
using System;
namespace ClassicalSharp.Events {
/// Contains events related to the spawning/despawning of entities,
/// and the creation/removal of tab list entries.
public sealed class EntityEvents : EventsBase {
IdEventArgs idArgs = new IdEventArgs();
/// Raised when an entity is spawned in the current world.
public event EventHandler Added;
public void RaiseAdded(byte id) { idArgs.Id = id; Raise(Added, idArgs); }
/// Raised when an entity is despawned from the current world.
public event EventHandler Removed;
public void RaiseRemoved(byte id) { idArgs.Id = id; Raise(Removed, idArgs); }
/// Raised when a tab list entry is created.
public event EventHandler TabListEntryAdded;
public void RaiseTabEntryAdded(byte id) { idArgs.Id = id; Raise(TabListEntryAdded, idArgs); }
/// Raised when a tab list entry is modified.
public event EventHandler TabListEntryChanged;
public void RaiseTabListEntryChanged(byte id) { idArgs.Id = id; Raise(TabListEntryChanged, idArgs); }
/// Raised when a tab list entry is removed.
public event EventHandler TabListEntryRemoved;
public void RaiseTabEntryRemoved(byte id) { idArgs.Id = id; Raise(TabListEntryRemoved, idArgs); }
}
public sealed class IdEventArgs : EventArgs {
public byte Id;
}
}