예제 #1
0
        public SCLogic(FF1Rom _rom, SCMain _main, List <IRewardSource> _itemPlacement, IVictoryConditionFlags _victoryConditions, bool _excludeBridge)
        {
            rom               = _rom;
            main              = _main;
            itemPlacement     = _itemPlacement;
            victoryConditions = _victoryConditions;
            excludeBridge     = _excludeBridge;

            locations = new OwLocationData(rom);
            locations.LoadData();

            GetShipDockArea();

            BuildTunnels();

            DoPathing();

            DoAirShipPathing();

            RemoveEmptyAreas();

            ProcessTreasures();

            ProcessShopSlot();

            ProcessNPCs();

            RewardSources = rewardSourceDic.Values.ToList();

            ProcessFreebies();
        }
예제 #2
0
        public SCMain(List <Map> _maps, OverworldMap _overworldMap, NPCdata _npcdata, OwLocationData locations, FF1Rom _rom)
        {
            maps         = _maps;
            overworldMap = _overworldMap;
            rom          = _rom;
            npcdata      = _npcdata;

            mapTileSets = new MapTileSets(rom);
            enter       = new EnterTeleData(rom);
            tele        = new NormTeleData(rom);
            exit        = new ExitTeleData(rom);

            mapTileSets.LoadTable();
            enter.LoadData();
            tele.LoadData();
            exit.LoadData();

            for (int i = 0; i < 8; i++)
            {
                tileSets[i] = new SCTileSet(rom, (byte)i);
            }

            owtileset = new SCTileSet(rom, TileSet.OverworldIndex);

            Stopwatch w = Stopwatch.StartNew();

            List <SCMap> tmpscmaps = new List <SCMap>();

            //Parallel.ForEach(Enum.GetValues<MapId>(), mapid => ProcessMap(mapid, tmpscmaps));

            foreach (var mapid in Enum.GetValues <MapId>())
            {
                ProcessMap(mapid, tmpscmaps);
            }

            scmaps = tmpscmaps.ToDictionary(m => m.MapId);

            ComposeDungeons();

            //SCCoords bridge = new SCCoords(0x98, 0x98);
            //SCCoords canal = new SCCoords(0x66, 0xA4);
            Overworld = new SCOwMap(overworldMap, SCMapCheckFlags.None, _rom, owtileset, enter, exit, locations.BridgeLocation, locations.CanalLocation);

            w.Stop();
        }