public bool EdgeCrossTest(string edgeName, float previous, float current) { IEdge edge = getEdge(edgeName); bool edgeCrossed = false; edge.OnEdgeCrossed.Subscribe((sender, e) => edgeCrossed = true); Mock <ICharacter> character = _mocks.Character(); setPosition(character, previous, edgeName); _edges.OnRepeatedlyExecute(character.Object); Assert.IsFalse(edgeCrossed); setPosition(character, current, edgeName); _edges.OnRepeatedlyExecute(character.Object); return(edgeCrossed); }
private void onRepeatedlyExecute(object sender, EventArgs args) { if (_player == null || _player.Room != this) { return; } cacheVisibleObjects(); _edges.OnRepeatedlyExecute(_player); }