/// <summary> /// Apply Speed Action. /// </summary> /// <param name="action"></param> /// <returns></returns> public bool ApplyAction(ActionSpeed action) { if (action.relative) { this.speed += action.speed; } else { this.speed = action.speed; } if (this.speed < 0) { this.speed = 0; } return(true); }
/// <summary> /// Apply Speed Action. /// </summary> /// <param name="action"></param> /// <returns></returns> public bool ApplyAction(ActionSpeed action) { if (action.relative) { this.speed += action.speed; } else { this.speed = action.speed; } if (this.speed < 0) { this.speed = 0; } if (_logRelativeActions && action.relative) { logger.Verbose("Speed set to " + this.speed); } return(true); }