-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the handling of unknown boss accessibility in Boss Shuffle to…
… return SequenceBreak if some boss types are defeatable and Normal if all boss types are defeatable. Changed the handling of dungeon items to return Partial if some of the items are accessible until the maximum number of items in the section that are accessible has been collected. Changed clearing a location to do so 1 item at a time to check for partial sections. Incremented version from 0.6.2 to 0.7.0 for release.
- Loading branch information
Showing
12 changed files
with
1,516 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using OpenTracker.Models.Enums; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace OpenTracker.Models | ||
{ | ||
public class BossDictionary : Dictionary<BossType, Boss>, INotifyPropertyChanged | ||
{ | ||
private readonly Game _game; | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
private AccessibilityLevel _unknownBossAccessibility; | ||
public AccessibilityLevel UnknownBossAccessibility | ||
{ | ||
get => _unknownBossAccessibility; | ||
private set | ||
{ | ||
if (_unknownBossAccessibility != value) | ||
{ | ||
_unknownBossAccessibility = value; | ||
OnPropertyChanged(nameof(UnknownBossAccessibility)); | ||
} | ||
} | ||
} | ||
|
||
public BossDictionary(Game game, int capacity) : base(capacity) | ||
{ | ||
_game = game; | ||
} | ||
|
||
private void OnPropertyChanged(string propertyName) | ||
{ | ||
if (PropertyChanged != null) | ||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
private void OnRequirementChanged(object sender, PropertyChangedEventArgs e) | ||
{ | ||
UpdateUnknownBossAccessibility(); | ||
} | ||
|
||
private void UpdateUnknownBossAccessibility() | ||
{ | ||
bool BossInaccessibility = false; | ||
|
||
foreach (Boss boss in Values) | ||
{ | ||
if (boss.Type != BossType.Aga) | ||
{ | ||
if (boss.Accessibility < AccessibilityLevel.SequenceBreak) | ||
{ | ||
BossInaccessibility = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if (BossInaccessibility) | ||
UnknownBossAccessibility = AccessibilityLevel.SequenceBreak; | ||
else | ||
UnknownBossAccessibility = AccessibilityLevel.Normal; | ||
} | ||
|
||
public void SubscribeToMemberEvents() | ||
{ | ||
foreach (Boss boss in Values) | ||
{ | ||
if (boss.Type != BossType.Aga) | ||
boss.PropertyChanged += OnRequirementChanged; | ||
} | ||
|
||
UpdateUnknownBossAccessibility(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.