Beispiel #1
0
        void Setup()
        {
            Instance   = this;
            GameObject = new GameObject();

            Areas    = new AreaManager();
            Factions = new FactionManager();
            Hud      = new HudManager();
            Pins     = new PinManager();
            Users    = new UserManager();
            Wars     = new WarManager();
            Zones    = new ZoneManager();

            Factions.Init(TryLoad <FactionInfo>(FactionsFile));
            Areas.Init(TryLoad <AreaInfo>(AreasFile));
            Pins.Init(TryLoad <PinInfo>(PinsFile));
            Users.Init();
            Wars.Init(TryLoad <WarInfo>(WarsFile));
            Zones.Init();
            Hud.Init();

            Hud.GenerateMapOverlayImage();

            if (Options.Upkeep.Enabled)
            {
                UpkeepCollectionTimer = timer.Every(Options.Upkeep.CheckIntervalMinutes * 60, Upkeep.CollectForAllFactions);
            }

            PrintToChat($"{Title} v{Version} initialized.");
            Ready = true;
        }
Beispiel #2
0
 public static void RegisterAll(Imperium instance)
 {
     foreach (FieldInfo field in typeof(Permission).GetFields(BindingFlags.Public | BindingFlags.Static))
     {
         instance.permission.RegisterPermission((string)field.GetRawConstantValue(), instance);
     }
 }
Beispiel #3
0
        void Unload()
        {
            Hud.Destroy();
            Zones.Destroy();
            Users.Destroy();
            Wars.Destroy();
            Pins.Destroy();
            Areas.Destroy();
            Factions.Destroy();

            if (UpkeepCollectionTimer != null && !UpkeepCollectionTimer.Destroyed)
            {
                UpkeepCollectionTimer.Destroy();
            }

            if (GameObject != null)
            {
                UnityEngine.Object.Destroy(GameObject);
            }

            Instance = null;
        }