Exemplo n.º 1
0
        public ushort[] LoadWalkableDuringFight()
        {
            var nonWalkable = Array.ConvertAll(CellsLosMov.Where(x => (x.Value & 2) != 0).ToArray(), x => x.Key);
            var walkable    = WalkableCells.ToList();

            walkable.RemoveAll(x => nonWalkable.Contains(x));
            return(walkable.ToArray());
        }
Exemplo n.º 2
0
        private void AnalyzeScene(Scene scene)
        {
            Parallel.ForEach(scene.NavZone.NavCells, cell =>
            {
                float x = scene.Position.X + cell.Min.X;
                float y = scene.Position.Y + cell.Min.Y;

                float sizex = cell.Max.X - cell.Min.X;
                float sizey = cell.Max.Y - cell.Min.Y;

                var rect = new Rect(x, y, sizex, sizey);

                // TODO: Feature request: Also allow drawing of NavCellFlags.NOSpawn, NavCellFlags.LevelAreaBit0, NavCellFlags.LevelAreaBit1 cells. /raist.

                if ((cell.Flags & Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk) != Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk)
                {
                    UnWalkableCells.Add(rect);
                }
                else
                {
                    WalkableCells.Add(rect);
                }
            });
        }
Exemplo n.º 3
0
 public ushort RandomWalkableCell()
 {
     return(WalkableCells.Random());
 }
Exemplo n.º 4
0
 public bool Walkable(ushort cellid)
 {
     return(WalkableCells.Contains(cellid));
 }