public static Savegame Load(ISavegameSerializer savegameSerializer, SavegameInputFiles savegameFiles, IFileContainer partyTextsContainer) { var savegame = new Savegame(); savegameSerializer.Read(savegame, savegameFiles, partyTextsContainer); return(savegame); }
public bool StopMovingTowards(Savegame savegame, int x, int y) { uint mapEventId = (Type == MapType.Map2D) ? Tiles[x, y].MapEventId : Blocks[x, y].MapEventId; if (mapEventId == 0 || !savegame.IsEventActive(Index, mapEventId - 1)) { return(false); } var @event = EventList[(int)mapEventId - 1]; return(@event.Type switch { EventType.Chest => true, EventType.Door => savegame.IsDoorLocked((@event as DoorEvent).DoorIndex), // Only locked doors block EventType.EnterPlace => true, EventType.Riddlemouth => true, _ => false });