Пример #1
0
        private void GameModule_TileLocationChanged(object sender, EventArgs ev)
        {
            BaseCharacter player = (BaseCharacter) sender;

            this.context.EventProvider.HandleEvent (player, ActivationTypes.Movement);

            ClientMovementMessage msg = new ClientMovementMessage ()
            {
                NetworkID = (uint) player.ID,
                X = player.Location.IntX,
                Y = player.Location.IntY,
                Direction = (int) player.Direction,
                Animation = player.CurrentAnimationName
            };

            this.network.Send (msg);
        }
Пример #2
0
        private void GameModule_StoppedMoving(object sender, EventArgs ev)
        {
            var player = (BaseCharacter) sender;

            player.CurrentAnimationName = player.Direction.ToString ();

            ClientMovementMessage msg = new ClientMovementMessage ()
            {
                NetworkID = (uint) player.ID,
                X = player.Location.IntX,
                Y = player.Location.IntY,
                Direction = (int) player.Direction,
                Animation = player.CurrentAnimationName
            };

            this.network.Send (msg);
        }