Beispiel #1
0
        public override void HandleMessageContents(NetworkMessage message, Connection connection)
        {
            var packet = new AutoMovePacket(message);
            var player = Game.Instance.GetCreatureWithId(connection.PlayerId) as Player;

            player?.AutoWalk(packet.Directions);
        }
Beispiel #2
0
        public void AutoMovePacket_Initialization()
        {
            Direction[] expectedDirections = new Direction[] { Direction.East, Direction.North, Direction.West, Direction.South, };

            IAutoMovementInfo autoMoveInfo = new AutoMovePacket(expectedDirections);

            CollectionAssert.AreEqual(expectedDirections, autoMoveInfo.Directions, $"Expected {nameof(autoMoveInfo.Directions)} to match {expectedDirections}.");
        }