Exemplo n.º 1
0
 private void UnregisterEvents()
 {
     CustomConfigs.Clear();                                         /* <- clear the list of configs */
     Qurre.Events.Round.Waiting -= EventHandlers.WaitingForPlayers; /* <- method unregister */
     Qurre.Events.Player.Join   -= EventHandlers.PlayerJoin;        /* <- method unregister */
     EventHandlers = null;                                          /* <- deleting a class with events */
 }
Exemplo n.º 2
0
 public override void Disable()
 {
     ServerEvent.Start -= handler.OnRoundStart;
     CustomConfigs.Remove(CustomConfig);
     handler   = null;
     Singleton = null;
 }
Exemplo n.º 3
0
 }                                                /* <- creating a new config class */
 #endregion
 #region RegEvents
 /* registration of events(you can use any name) */
 private void RegisterEvents()
 {
     CustomConfig = new Config();
     CustomConfigs.Add(CustomConfig);                               /* <- Add and initialize the configuration */
     EventHandlers = new EventHandlers(this);                       /* <- class declaration with events */
     Qurre.Events.Round.Waiting += EventHandlers.WaitingForPlayers; /* <- method register */
     Qurre.Events.Player.Join   += EventHandlers.PlayerJoin;        /* <- method register */
 }
Exemplo n.º 4
0
        public override void Enable()
        {
            CustomConfigs.Add(CustomConfig);
            if (!CustomConfig.IsEnabled)
            {
                return;
            }
            Singleton = this;
            handler   = new Handler(CustomConfig);

            ServerEvent.Start += handler.OnRoundStart;
        }