예제 #1
0
 private void SetShipDock(SCCoords coords)
 {
     if ((main.Overworld.Tiles[coords.X, coords.Y].Tile & SCBitFlags.ShipDock) > 0)
     {
         shipDockArea = main.Overworld.Areas[main.Overworld.Tiles[coords.X, coords.Y].Area];
     }
 }
예제 #2
0
        private void DoPathing()
        {
            areadic = new List <SCOwArea>(4096);

            var start = new SCCoords(0, 0);

            var startingarea = new SCOwArea(0, Tiles[start.X, start.Y].Tile);

            startingarea.Start = start;
            areadic.Add(startingarea);
            Tiles[start.X, start.Y].Area = startingarea.Index;

            CheckTile(start.OwLeft, startingarea.Index, startingarea.Tile);
            CheckTile(start.OwRight, startingarea.Index, startingarea.Tile);
            CheckTile(start.OwUp, startingarea.Index, startingarea.Tile);
            CheckTile(start.OwDown, startingarea.Index, startingarea.Tile);

            ProcessImmediates();

            while (deferredqueue.Count > 0)
            {
                ProcessDeferred();
                ProcessImmediates();
            }
        }
예제 #3
0
        public SCEntrance(SCMap _map, SCCoords _coords)
        {
            Map    = _map;
            Coords = _coords;

            InstatiateMapData();
            DoPathing();
            ProcessPointsOfInterest();
        }
예제 #4
0
        private void CheckTile(SCCoords coords, SCBitFlags requirements)
        {
            var tile = Tiles[coords.X, coords.Y];

            requirements |= tile.Tile;

            if (!tile.Tile.IsBlocked() && Tiles[coords.X, coords.Y].MergeFlag(requirements) && !tile.Tile.IsImpassable())
            {
                todoset.Enqueue(new SCTileQueueEntry {
                    BitFlags = requirements, Coords = coords
                });
            }
        }
예제 #5
0
        private void CheckTile(SCCoords coords, short area, SCBitFlags tile)
        {
            if (Tiles[coords.X, coords.Y].Area >= 0)
            {
                return;
            }

            if (Tiles[coords.X, coords.Y].Tile == tile)
            {
                Tiles[coords.X, coords.Y].Area = area;

                immediatequeue.Enqueue(new SCOwTileQueueEntry {
                    Coords = coords, Area = area, Tile = tile
                });
            }
            else
            {
                deferredqueue.Enqueue(new SCOwTileQueueEntry {
                    Coords = coords, Area = area
                });
            }
        }
예제 #6
0
        public SCOwMap(OverworldMap _map, SCMapCheckFlags cflags, FF1Rom _rom, SCTileSet _tileSet, EnterTeleData _enter, ExitTeleData _exit, SCCoords bridge, SCCoords canal)
        {
            CFlags = cflags;

            map     = _map;
            rom     = _rom;
            tileSet = _tileSet;

            enter = _enter;
            exit  = _exit;

            Bridge = bridge;
            Canal  = canal;

            ProcessTiles();
            ProcessTeleporters();
            ProcessSpecialPointOfInterests();

            DoPathing();

            ProcessPointsOfInterest();

            FilterAreas();
        }
 public SCTeleport(TeleData t, SCPointOfInterestType type)
 {
     Type         = type;
     TargetMap    = t.Map;
     TargetCoords = new SCCoords(t.X, t.Y).SmClamp;
 }
예제 #8
0
 private SCBitFlagSet GetBitFlagSetFromTile(SCCoords coords)
 {
     return(Tiles[coords.X, coords.Y].GetBitFlagSet());
 }