/// <summary> /// Method fired when an Entity collide with another one /// </summary> /// <param name="sender">Always null</param> /// <param name="e">The entity who stops colliding</param> private void OnEntityCollidedEnter(object sender, CollidableEntity e) { Logging.Logger.Log(Logging.Logger.LogLevel.DEBUG, "Intersect !"); SetWorldPosition(_previousWorldPosition); _previousWorldPosition = WorldPosition; _collideWith.Add(e.Id, e); }
/// <summary> /// Method fired when an Entity stop colliding with another one /// </summary> /// <param name="sender">Always null</param> /// <param name="e">The entity who stops colliding</param> private void OnEntityCollidedExit(object sender, CollidableEntity e) { _collideWith.Remove(e.Id); }
/// <summary> /// Method fired when an Entity stay in collision with another one /// </summary> /// <param name="sender">Always null</param> /// <param name="e">The entity who stops colliding</param> private void OnEntityCollidedStay(object sender, CollidableEntity e) { SetWorldPosition(_previousWorldPosition); _previousWorldPosition = WorldPosition; }