예제 #1
0
        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();
            };
        }
예제 #2
0
 internal void HandlePreStart()
 {
     OnPreStart?.Invoke();
 }
예제 #3
0
 internal static void HandlePreStart(Resource resource)
 {
     OnPreStart?.Invoke(resource);
 }