void UpdateFromRom(RawEntranceCollection rawEntranceCollection, RawExitCollection rawExitCollection, RawItemLocationCollection rawItemLocationCollection, RawItemEdgeCollection rawItemEdgeCollection) { UpdateEntrances(rawEntranceCollection); UpdateExits(rawExitCollection); UpdateItems(rawItemLocationCollection); UpdateMedallions(rawItemEdgeCollection); }
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); }
void UpdateEntrances(RawEntranceCollection rawEntranceCollection) { List <RawEntrance> originalEntrances = rawEntranceCollection.RawEntrances.ToList(); List <RawOverworldEntrance> originalOverworldEntrances = rawEntranceCollection.RawOverworldEntrances.ToList(); foreach (var e in romEntrances.Entrances) { var newEntrance = originalEntrances.Where(x => x.EntranceId == e.EntranceNumber).FirstOrDefault(); var owEntrance = rawEntranceCollection.RawOverworldEntrances.Where(x => x.EntranceAddress == e.EntranceAddress).FirstOrDefault(); if (owEntrance != null && newEntrance != null) { owEntrance.LogicalEntranceId = newEntrance.LogicalEntranceId; } } }
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(); }
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; }