/************************************************************************* * ModernUO * * Copyright (C) 2020 - ModernUO Development Team * * Email: hi@modernuo.com * * File: EventSink.cs * * Created: 2020/04/11 - Updated: 2020/04/11 * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * *************************************************************************/ using System; using System.Collections.Generic; using Server.Network; namespace Server { public static partial class EventSink { public static event Action OpenDoorMacroUsed; public static void InvokeOpenDoorMacroUsed(Mobile m) => OpenDoorMacroUsed?.Invoke(m); public static event Action Login; public static void InvokeLogin(Mobile m) => Login?.Invoke(m); public static event Action HungerChanged; public static void InvokeHungerChanged(Mobile mobile, int oldValue) => HungerChanged?.Invoke(mobile, oldValue); public static event Action Shutdown; public static void InvokeShutdown() => Shutdown?.Invoke(); public static event Action HelpRequest; public static void InvokeHelpRequest(Mobile m) => HelpRequest?.Invoke(m); public static event Action DisarmRequest; public static void InvokeDisarmRequest(Mobile m) => DisarmRequest?.Invoke(m); public static event Action StunRequest; public static void InvokeStunRequest(Mobile m) => StunRequest?.Invoke(m); public static event Action OpenSpellbookRequest; public static void InvokeOpenSpellbookRequest(Mobile m, int type) => OpenSpellbookRequest?.Invoke(m, type); public static event Action CastSpellRequest; public static void InvokeCastSpellRequest(Mobile m, int spellID, Item book) => CastSpellRequest?.Invoke(m, spellID, book); public static event Action BandageTargetRequest; public static void InvokeBandageTargetRequest(Mobile m, Item bandage, Mobile target) => BandageTargetRequest?.Invoke(m, bandage, target); public static event Action AnimateRequest; public static void InvokeAnimateRequest(Mobile m, string action) => AnimateRequest?.Invoke(m, action); public static event Action Logout; public static void InvokeLogout(Mobile m) => Logout?.Invoke(m); public static event Action Connected; public static void InvokeConnected(Mobile m) => Connected?.Invoke(m); public static event Action Disconnected; public static void InvokeDisconnected(Mobile m) => Disconnected?.Invoke(m); public static event Action RenameRequest; public static void InvokeRenameRequest(Mobile from, Mobile target, string name) => RenameRequest?.Invoke(from, target, name); public static event Action PlayerDeath; public static void InvokePlayerDeath(Mobile m) => PlayerDeath?.Invoke(m); public static event Action VirtueGumpRequest; public static void InvokeVirtueGumpRequest(Mobile beholder, Mobile beheld) => VirtueGumpRequest?.Invoke(beholder, beheld); public static event Action VirtueItemRequest; public static void InvokeVirtueItemRequest(Mobile beholder, Mobile beheld, int gumpID) => VirtueItemRequest?.Invoke(beholder, beheld, gumpID); public static event Action VirtueMacroRequest; public static void InvokeVirtueMacroRequest(Mobile mobile, int virtueID) => VirtueMacroRequest?.Invoke(mobile, virtueID); public static event Action ChatRequest; public static void InvokeChatRequest(Mobile m) => ChatRequest?.Invoke(m); public static event Action PaperdollRequest; public static void InvokePaperdollRequest(Mobile beholder, Mobile beheld) => PaperdollRequest?.Invoke(beholder, beheld); public static event Action ProfileRequest; public static void InvokeProfileRequest(Mobile beholder, Mobile beheld) => ProfileRequest?.Invoke(beholder, beheld); public static event Action ChangeProfileRequest; public static void InvokeChangeProfileRequest(Mobile beholder, Mobile beheld, string text) => ChangeProfileRequest?.Invoke(beholder, beheld, text); public static event Action DeleteRequest; public static void InvokeDeleteRequest(NetState state, int index) => DeleteRequest?.Invoke(state, index); public static event Action WorldLoad; public static void InvokeWorldLoad() => WorldLoad?.Invoke(); public static event Action WorldSave; public static void InvokeWorldSave(bool sendMessage) => WorldSave?.Invoke(sendMessage); public static event Action SetAbility; public static void InvokeSetAbility(Mobile mobile, int index) => SetAbility?.Invoke(mobile, index); public static event Action ServerStarted; public static void InvokeServerStarted() => ServerStarted?.Invoke(); public static event Action GuildGumpRequest; public static void InvokeGuildGumpRequest(Mobile m) => GuildGumpRequest?.Invoke(m); public static event Action QuestGumpRequest; public static void InvokeQuestGumpRequest(Mobile m) => QuestGumpRequest?.Invoke(m); public static event Action ClientVersionReceived; public static void InvokeClientVersionReceived(NetState state, ClientVersion cv) => ClientVersionReceived?.Invoke(state, cv); public static event Action> EquipMacro; public static void InvokeEquipMacro(Mobile m, List list) { if (list?.Count > 0) EquipMacro?.Invoke(m, list); } public static event Action> UnequipMacro; public static void InvokeUnequipMacro(Mobile m, List layers) { if (layers?.Count > 0) UnequipMacro?.Invoke(m, layers); } public static event Action TargetedSpell; public static void InvokeTargetedSpell(Mobile m, IEntity target, int spellId) => TargetedSpell?.Invoke(m, target, spellId); public static event Action TargetedSkillUse; public static void InvokeTargetedSkillUse(Mobile m, IEntity target, int skillId) => TargetedSkillUse?.Invoke(m, target, skillId); public static event Action TargetByResourceMacro; public static void InvokeTargetByResourceMacro(Mobile m, Item item, short resourceType) => TargetByResourceMacro?.Invoke(m, item, resourceType); } }