Ejemplo n.º 1
0
 public static PlayerDroneManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = new PlayerDroneManager();
     }
     return _instance;
 }
Ejemplo n.º 2
0
 public static PlayerDroneManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = new PlayerDroneManager();
     }
     return(_instance);
 }
        public void Update(int ticks)
        {
            try
            {
                if (cManager == null)
                {
                    cManager = ConquestDroneManager.GetInstance();
                    pManager = PlayerDroneManager.GetInstance();
                }

                if (ticks % _logSaveRate == 0)
                {
                    Util.SaveLogs();
                }

                if (ticks % _loadSaveSettingsRate == 0)
                {
                    Util.GetInstance().LoadCustomGameSettings();
                    Util.GetInstance()
                    .Log("[ConquestMod.Update] loaded game settings -> player droneCount:" +
                         Util.GameSettings.MaxPlayerDroneCount + " conquest dronepersquad:" +
                         Util.GameSettings.MaxNumDronesPerConquestSquad + " conquest numdronesquads:" +
                         Util.GameSettings.MaxNumConquestSquads, "ConquestMod.txt");

                    if (!displayedHelp)
                    {
                        Util.GetInstance().Help();
                        displayedHelp = true;
                    }
                }

                if (ticks % _conquestUpdateRate == 0)
                {
                    FindAllDrones();
                    //CalculateDistances();
                    pManager.Update();
                    cManager.Update();
                }

                if (ticks % _findDroneRate == 0)
                {
                    Util.GetInstance()
                    .Log(
                        "[ConquestMod.Update] loaded game settings -> player Building drones:" + GetDrones().Count,
                        "ConquestMod.txt");
                    cManager.RebuildLostDrones();
                }
            }
            catch (Exception e)

            {
                Util.GetInstance().LogError(e.ToString());
            }
        }
        public void Update(int ticks)
        {
            try
            {
                if (cManager == null)
                {
                    cManager = ConquestDroneManager.GetInstance();
                    pManager = PlayerDroneManager.GetInstance();
                }

                if (ticks%_logSaveRate == 0)
                {
                    Util.SaveLogs();
                }

                if (ticks%_loadSaveSettingsRate == 0)
                {
                    Util.GetInstance().LoadCustomGameSettings();
                    Util.GetInstance()
                        .Log("[ConquestMod.Update] loaded game settings -> player droneCount:" +
                             Util.GameSettings.MaxPlayerDroneCount + " conquest dronepersquad:" +
                             Util.GameSettings.MaxNumDronesPerConquestSquad + " conquest numdronesquads:" +
                             Util.GameSettings.MaxNumConquestSquads, "ConquestMod.txt");

                    if (!displayedHelp)
                    {

                        Util.GetInstance().Help();
                        displayedHelp = true;
                    }
                }

                if (ticks%_conquestUpdateRate == 0)
                {
                    FindAllDrones();
                    //CalculateDistances();
                    pManager.Update();
                    cManager.Update();
                }

                if (ticks%_findDroneRate == 0)
                {
                    Util.GetInstance()
                        .Log(
                            "[ConquestMod.Update] loaded game settings -> player Building drones:" + GetDrones().Count,
                            "ConquestMod.txt");
                    cManager.RebuildLostDrones();
                }
            }
            catch (Exception e)

            {
                Util.GetInstance().LogError(e.ToString());
            }
        }