Exemplo n.º 1
0
 void UpdateItems(RawItemLocationCollection rawItemLocationCollection)
 {
     foreach (var l in romChests.Chests)
     {
         var itemLocation = rawItemLocationCollection.RawItemLocations.Values.Where(x => x.LocationAddress == l.Address).FirstOrDefault();
         itemLocation.ItemId   = l.ItemId;
         itemLocation.ItemName = GameItems.Values.Where(x => x.Id == l.ItemId).Select(x => x.LogicalId).FirstOrDefault();
     }
 }
Exemplo n.º 2
0
        public GraphData()
        {
            RawEntranceCollection     rawEntranceCollection     = new RawEntranceCollection();
            RawExitCollection         rawExitCollection         = new RawExitCollection();
            RawItemLocationCollection rawItemLocationCollection = new RawItemLocationCollection();
            RawItemEdgeCollection     rawItemEdgeCollection     = new RawItemEdgeCollection();
            RawRoomEdgeCollection     rawRoomEdgeCollection     = new RawRoomEdgeCollection();

            FillNodesAndEdges(rawEntranceCollection, rawExitCollection, rawItemLocationCollection, rawItemEdgeCollection, rawRoomEdgeCollection);
        }
Exemplo n.º 3
0
 public void LoadChests(RawItemLocationCollection rawItemLocations)
 {
     foreach (var locations in rawItemLocations.RawItemLocations.Values
              .Where(x => x.LocationAddress > 2)                                // skip any fake items like the frog or purple chest
              .Select(x => x.LocationAddress)
              )
     {
         Chests.Add(new RomChest(romData, locations));
     }
 }
Exemplo n.º 4
0
        public GraphData(RomData romData, OptionFlags optionFlags, RomEntranceCollection romEntrances, RomExitCollection romExits, RomChestCollection romChests)
        {
            this.romData      = romData;
            this.romEntrances = romEntrances;
            this.romExits     = romExits;
            this.romChests    = romChests;

            RawEntranceCollection     rawEntranceCollection     = new RawEntranceCollection();
            RawExitCollection         rawExitCollection         = new RawExitCollection();
            RawItemLocationCollection rawItemLocationCollection = new RawItemLocationCollection();
            RawItemEdgeCollection     rawItemEdgeCollection     = new RawItemEdgeCollection();
            RawRoomEdgeCollection     rawRoomEdgeCollection     = new RawRoomEdgeCollection();

            romChests.LoadChests(rawItemLocationCollection);

            UpdateFromRom(rawEntranceCollection, rawExitCollection, rawItemLocationCollection, rawItemEdgeCollection);
            UpdateFromOptions(optionFlags, rawRoomEdgeCollection);
            FillNodesAndEdges(rawEntranceCollection, rawExitCollection, rawItemLocationCollection, rawItemEdgeCollection, rawRoomEdgeCollection);

            _rawItemLocationCollection = rawItemLocationCollection;
        }
Exemplo n.º 5
0
 void UpdateFromRom(RawEntranceCollection rawEntranceCollection, RawExitCollection rawExitCollection, RawItemLocationCollection rawItemLocationCollection, RawItemEdgeCollection rawItemEdgeCollection)
 {
     UpdateEntrances(rawEntranceCollection);
     UpdateExits(rawExitCollection);
     UpdateItems(rawItemLocationCollection);
     UpdateMedallions(rawItemEdgeCollection);
 }
Exemplo n.º 6
0
        void FillNodesAndEdges(RawEntranceCollection rawEntranceCollection, RawExitCollection rawExitCollection, RawItemLocationCollection rawItemLocationCollection, RawItemEdgeCollection rawItemEdges, RawRoomEdgeCollection rawRoomEdges)
        {
            _overworldNodes = new Data.OverworldNodes();
            _roomNodes      = new Data.RoomNodes();
            _bossNodes      = new Data.BossNodes();
            _itemNodes      = new Data.ItemLocations(rawItemLocationCollection);
            FillAllNodes();

            _areaEdges = new Data.AreaEdges(_overworldNodes);
            _roomEdges = new Data.RoomEdges(_roomNodes, _overworldNodes, _bossNodes, rawRoomEdges);
            _itemEdges = new ItemEdges(this, rawItemEdges);

            _entranceEdges = new EntranceEdges(_overworldNodes, _roomNodes, rawEntranceCollection, rawItemLocationCollection);
            _exitEdges     = new ExitEdges(_overworldNodes, _roomNodes, rawExitCollection);

            FillAllEdges();
        }