Beispiel #1
0
        public Spot GetToSpot(PathGraph pg, int i)
        {
            float x, y, z;

            GetPath(i, out x, out y, out z);
            return(pg.GetSpot(x, y, z));
        }
Beispiel #2
0
 public EasyMover(PPather pather, Location target, bool GiveUpIfStuck, bool GiveUpIfUnsafe)
 {
     this.target = target;
     this.Me = BoogieCore.Player;
     this.world = pather.world;
     mover = PPather.mover;
     this.GiveUpIfStuck = GiveUpIfStuck;
     this.GiveUpIfUnsafe = GiveUpIfUnsafe;
     this.pather = pather;
 }
Beispiel #3
0
        public List <Spot> GetPathsToSpots(PathGraph pg)
        {
            List <Spot> list = new List <Spot>(n_paths);

            for (int i = 0; i < n_paths; i++)
            {
                list.Add(GetToSpot(pg, i));
            }
            return(list);
        }
Beispiel #4
0
 public bool HasPathTo(PathGraph pg, Spot s)
 {
     for (int i = 0; i < n_paths; i++)
     {
         Spot to = GetToSpot(pg, i);
         if (to == s)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #5
0
 public MoveAlonger(PPather pather, Path path)
 {
     this.Me = BoogieCore.Player;
     this.path = path;
     this.world = pather.world;
     mover = PPather.mover;
     sd = new StuckDetecter(pather, 1, 2);
     prev = null;
     current = path.GetFirst();
     next = path.GetSecond();
 }
Beispiel #6
0
 public bool HasPathTo(PathGraph pg, Spot s)
 {
     for (int i = 0; i < n_paths; i++)
     {
         Spot to = GetToSpot(pg, i);
         if (to == s)
             return true;
     }
     return false;
 }
Beispiel #7
0
 public Spot GetToSpot(PathGraph pg, int i)
 {
     float x, y, z;
     GetPath(i, out x, out y, out z);
     return pg.GetSpot(x, y, z);
 }
Beispiel #8
0
 public List<Spot> GetPathsToSpots(PathGraph pg)
 {
     List<Spot> list = new List<Spot>(n_paths);
     for (int i = 0; i < n_paths; i++)
     {
         list.Add(GetToSpot(pg, i));
     }
     return list;
 }
Beispiel #9
0
        private void Startup()
        {
            RunState = RunState_e.Paused;
            WantedState = RunState_e.Running;

            BoogieCore.Log(LogType.System, "TotalMemory before " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");

            WasAt = null;

            string zone = FigureOutZone();

            MPQTriangleSupplier mpq = new MPQTriangleSupplier();
            CurrentContinent = mpq.SetZone(zone);

            BoogieCore.Log(LogType.System, "Zone is : " + zone);
            BoogieCore.Log(LogType.System, "Continent is : " + CurrentContinent);

            string myFaction = "Unknown";

            ChunkedTriangleCollection triangleWorld = new ChunkedTriangleCollection(512);
            triangleWorld.SetMaxCached(9);
            triangleWorld.AddSupplier(mpq);

            world = new PathGraph(CurrentContinent, triangleWorld, null);
            mover = new Mover();
            radar = new UnitRadar();
            BoogieCore.Log(LogType.System, "Pather loaded!");

            while (ShouldRun)
            {
                Thread.Sleep(100);
            }
        }
Beispiel #10
0
        public void OnStopGlide()
        {
            BoogieCore.Log(LogType.System, "Inside OnStopGlider()");

            WantedState = RunState_e.Stopped;
            RunState = RunState_e.Stopped;

            SaveAllState();

            if (world != null)
                world.Close();

            BoogieCore.Log(LogType.System, "TotalMemory " + System.GC.GetTotalMemory(false) / (1024 * 1024) + " MB");
            world = null; // release RAM

            BoogieCore.Log(LogType.System, "TotalMemory after GC " + System.GC.GetTotalMemory(true) / (1024 * 1024) + " MB");
        }