예제 #1
0
        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);
        }
예제 #2
0
 private void onRepeatedlyExecute(object sender, EventArgs args)
 {
     if (_player == null || _player.Room != this)
     {
         return;
     }
     cacheVisibleObjects();
     _edges.OnRepeatedlyExecute(_player);
 }