void OnSequenceCompleted(PasswordLock sender) { if (sender != _passwordLock) { return; } PlaySecretSound(); OnExitedLostSector(); }
void OnCorrectEntryAddedToSequence(PasswordLock sender, Object entry) { if (sender != _passwordLock) { return; } if (_passwordLock.RemainingEntriesNeeded == 1) { OnSequenceIsOneAwayFromCompleted(); } }
void InitPasswordLock() { List <LostSectorPortal> solutionPortals = new List <LostSectorPortal>(); foreach (IndexDirection2.DirectionEnum d in _solution) { IndexDirection2 dir = IndexDirection2.FromDirectionEnum(d); LostSectorPortal portal = DirectionToPortal(dir); solutionPortals.Add(portal); } _passwordLock = new PasswordLock(solutionPortals.ToArray()); _passwordLock.CorrectEntryCallback += OnCorrectEntryAddedToSequence; _passwordLock.IncorrectEntryCallback += OnIncorrectEntryAddedToSequence; _passwordLock.CorrectPasswordEnteredCallback += OnSequenceCompleted; }
void OnIncorrectEntryAddedToSequence(PasswordLock sender, Object entry) { OverrideSectorsWithThisSector(IndexDirection2.AllValidNonZeroDirections, true); }