protected Resource(MtaResource resource) { resources.Add(resource, this); MtaResource = resource; GameServer.OnStart += (Elements.ResourceRootElement source, Game.Events.OnStartEventArgs eventArgs) => { if (eventArgs.Resource.MtaResource != this.MtaResource) { return; } OnStart?.Invoke(); }; GameServer.OnPreStart += (Elements.ResourceRootElement source, Game.Events.OnPreStartEventArgs eventArgs) => { if (eventArgs.Resource.MtaResource != this.MtaResource) { return; } OnPreStart?.Invoke(); }; GameServer.OnStop += (Elements.ResourceRootElement source, Game.Events.OnStopEventArgs eventArgs) => { if (eventArgs.Resource.MtaResource != this.MtaResource) { return; } OnStop?.Invoke(); }; }
internal void HandlePreStart() { OnPreStart?.Invoke(); }
internal static void HandlePreStart(Resource resource) { OnPreStart?.Invoke(resource); }