private void OnPositionChanged(ServerDynamicEntityMoveEventArgs e)
        {
            var handler = PositionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #2
0
        private void EntityPositionChanged(object sender, ServerDynamicEntityMoveEventArgs e)
        {
            // retranslate
            OnEntityMoved(new EntityMoveEventArgs {
                Entity           = e.ServerDynamicEntity.DynamicEntity,
                PreviousPosition = e.PreviousPosition
            });

            // we need to tell area manager that entity leaves us, to put it into new area
            if (!_rectangle.Contains(e.ServerDynamicEntity.DynamicEntity.Position.AsVector3()))
            {
                OnEntityLeave(new EntityLeaveAreaEventArgs {
                    Entity           = e.ServerDynamicEntity,
                    PreviousPosition = e.PreviousPosition
                });

                RemoveEntity(e.ServerDynamicEntity.GetHashCode());
            }
        }