Removed redundant parameter.

This commit is contained in:
Felix Ableitner 2012-12-22 16:52:43 +01:00
parent e6b6bc58fc
commit 88270ad28c
6 changed files with 8 additions and 9 deletions

View File

@ -110,10 +110,9 @@ Body::doesCollide(Body& other) {
* to manage collision events.
*
* @param other Reference to the other Physical in the collision.
* @param category The Category of the other object (as passed in constructor).
*/
void
Body::onCollide(Body& other, Category type) {
Body::onCollide(Body& other) {
}
/**

View File

@ -68,7 +68,7 @@ public:
sf::Vector2i getSize() const;
virtual bool doesCollide(Body& other);
virtual void onCollide(Body& other, Category category);
virtual void onCollide(Body& other);
// Public variables.
public:

View File

@ -41,11 +41,11 @@ Bullet::Bullet(const sf::Vector2f& position, Body& shooter, float direction,
* @copydoc Physical::onCollide
*/
void
Bullet::onCollide(Body& other, Category type) {
Bullet::onCollide(Body& other) {
// Make sure we do not damage twice.
if (!getDelete()) {
// Call onShot on other, with damage as param.
if (type == CATEGORY_ACTOR) {
if (other.getCategory() == CATEGORY_ACTOR) {
Character& a = dynamic_cast<Character&>(other);
a.onDamage(mDamage);
}

View File

@ -25,7 +25,7 @@ public:
Bullet(const sf::Vector2f& position, Body& shooter, float direction,
const Yaml& config);
void onCollide(Body& other, Category category);
void onCollide(Body& other);
bool doesCollide(Body& other);
// Private variables.

View File

@ -103,8 +103,8 @@ Player::onThink(float elapsedTime) {
* Stop movement if we collide with anything except bullets.
*/
void
Player::onCollide(Body& other, Category category) {
if (category != CATEGORY_PARTICLE) {
Player::onCollide(Body& other) {
if (other.getCategory() != CATEGORY_PARTICLE) {
setDestination(getPosition());
}
}

View File

@ -50,7 +50,7 @@ public:
// Private functions.
private:
void onCollide(Body& other, Category category);
void onCollide(Body& other);
void onThink(float elapsedTime);
// Private variables.