This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/sprites/Player.h

65 lines
1.5 KiB
C
Raw Normal View History

2012-10-14 16:14:06 +00:00
/*
* Player.h
*
* Created on: 21.07.2012
* Author: Felix
*/
#ifndef DG_PLAYER_H_
#define DG_PLAYER_H_
#include "../abstract/Character.h"
2013-03-29 17:34:51 +00:00
class World;
2012-10-14 16:14:06 +00:00
/**
* Player object.
*/
class Player : public Character {
public:
/**
* Movement directions that can be set via Player::setDirection().
*/
enum Direction : unsigned char {
2012-10-14 16:14:06 +00:00
RIGHT = 1 << 0,
LEFT = 1 << 1,
UP = 1 << 2,
DOWN = 1 << 3
};
2012-09-12 12:21:57 +00:00
public:
2013-04-29 14:49:16 +00:00
explicit Player(World& world, Pathfinder& pathfinder,
const Vector2f& position);
2012-10-14 16:14:06 +00:00
Vector2f getCrosshairPosition() const;
void setCrosshairPosition(const Vector2f& position);
using Character::pullTrigger;
using Character::releaseTrigger;
2012-10-14 16:14:06 +00:00
void setDirection(Direction direction, bool unset);
void setDestination(const Vector2f& destination);
using Character::getMagazineAmmo;
using Character::getTotalAmmo;
2013-07-06 11:38:15 +00:00
using Character::getWeaponName;
using Character::reload;
2013-06-25 20:00:40 +00:00
using Character::toggleWeapon;
using Character::selectFirstWeapon;
using Character::selectSecondWeapon;
2013-07-06 19:21:25 +00:00
using Character::setLeftGadget;
using Character::setRightGadget;
using Character::useLeftGadget;
using Character::useRightGadget;
2013-07-06 12:37:16 +00:00
using Character::getHealth;
2013-07-10 21:41:24 +00:00
using Character::getLeftGadgetName;
using Character::getRightGadgetName;
2013-07-21 08:52:50 +00:00
using Character::pickUpItem;
2012-10-14 16:14:06 +00:00
private:
2013-06-25 16:12:50 +00:00
void onThink(int elapsed) override;
2012-10-14 16:14:06 +00:00
private:
Vector2f mCrosshairPosition; //< Relative position of the point to fire at (mouse cursor).
unsigned char mDirection; //< Current movement direction for direct control.
2012-10-14 16:14:06 +00:00
};
#endif /* DG_PLAYER_H_ */