Show Player.h syntax highlighted
/**
**************************************************************************************
*Palisma - Secrets of the Illuminati is an open-source 2D RPG *
*Copyright (C) 2006, Tony Sparks *
* *
*This library is free software; you can redistribute it and/or *
*modify it under the terms of the GNU Lesser General Public *
*License as published by the Free Software Foundation; either *
*version 2.1 of the License, or (at your option) any later version. *
* *
*This library is distributed in the hope that it will be useful, *
*but WITHOUT ANY WARRANTY; without even the implied warranty of *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
*Lesser General Public License for more details. *
* *
*You should have received a copy of the GNU Lesser General Public *
*License along with this library; if not, write to the Free Software *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
**************************************************************************************
*/
#pragma once
#include "IEntity.h"
#include "EntityStates.h"
#include "StateMachine.h"
#include "PlayerConfig.h"
#include "../EventManager.h"
#include "MissionHolder.h"
#include "../script/LUA_Player.h"
#include <map>
struct buttons_t
{
// buttons held down
int buttons;
int btnPressed;
int btnReleased;
};
/**
==================================
Player - our hero
==================================
*/
class Player : public IEntity//, public IEventListener
{
public:
Player(void);
/** Get the Entity Type */
int GetType() { return TYPE_PLAYER; };
/** Update the Player */
void Update( long dt);
/** Apply a Trigger */
void Trigger();
/** Collide with another entity */
bool CollideWith( IEntity* ent );
/** Damage this entity */
int Damage( int hit );
/** Pick Up an Item */
void PickUpItem(IEntity* ent);
/** Buttons being pressed by the user */
buttons_t *GetButtons() { return &buttons; };
/** This is a player */
bool IsPlayer() { return true; };
///*-----------------------------------------
// IEventListener Interface
//------------------------------------------*/
//
///* Get the Name of the Listener */
//std::string GetName() { return "playerlistener"; };
//
///** Get Listener Type - Events this listener listens too */
//int GetListenerType() { return LT_ENTITY; };
/////** Handle an event */
////bool HandleEvent( IEvent* e );
private:
// check to user input
buttons_t buttons;
// the players config
PlayerConfig m_config;
// TEMP - should move somewhere else!!!
MissionDispatcher m_dispatcher;
// Bag of missions to accomplish
MissionHolder m_missions;
// for scripting abilities
friend LUA_Player;
public:
virtual ~Player(void);
};
See more files for this project here