コード例 #1
0
        public void Move_MovesEntity()
        {
            var result = positionSystem.CoordinateOf(mover);

            result.Should().BeEquivalentTo(GetTestMapCoordinate());

            positionSystem.Move(mover, new Vector(1, 1));

            result = positionSystem.CoordinateOf(mover);

            result.Should().BeEquivalentTo(GetTestMapCoordinate(x: 1, y: 1));
        }
コード例 #2
0
        public bool Apply(EventType type, IEntity sender, object eventData)
        {
            var vector = (Vector)eventData;

            positionSystem.Move(sender, vector);
            _animatedMovementSystem.StartAnimatedMovement(sender, vector, 500);

            eventRuleSystem.Try(EventType.SpendTime, sender, new SpendTimeEventData()
            {
                Ticks = sender.Get <Actor>().Speed
            });

            return(true);
        }