Show paintable.h syntax highlighted
/***************************************************************************
paintable.h
-------------------
begin : Mon Jan 10 2005
copyright : (C) 2005 by Brendon Lloyd Higgins
email : bh_doc@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef PAINTABLE_H_INCLUDED
#define PAINTABLE_H_INCLUDED
#include <worldpos.h>
class WorldClient;
class Rotation;
/**
* An interface for something that can be drawn by the client.
* \note This was called Drawable, but that conflicted with an X11 typedef.
*/
class Paintable {
public:
/**
* Constructor.
*/
Paintable();
/**
* Destructor.
*/
virtual ~Paintable();
/**
* Update animation etc variables. Default is no-op.
* \param w The world in which we live.
* \param d The delay since the previous update in ms.
* \return If the object should be deleted return false, else return true.
* Regular entities should always return true. Only non-entity paintables
* should ever return false to be removed from the client's list.
* \warning Don't return false if remove is true.
*/
virtual bool drawUpdate(const WorldClient* w, unsigned int d);
/**
* Perform the draw.
*/
virtual void draw(const WorldClient* w) const = 0;
/**
* Get the sort index for drawing. Lower numbers are drawn first.
*/
virtual int drawSortIndex(const WorldClient* w) const = 0;
/**
* This gets called when a player changes their designation colour.
* You should override this when your paintable uses the player's colour.
* \note It might be another player who's colour has changed.
*/
virtual void playerColourChange(WorldClient* w);
/**
* This gets called when the display rotation changes. Default is to
* ignore it.
* \param w The world.
* \param r The new display rotation.
*/
virtual void displayRotationChange(WorldClient* w, const Rotation& r);
};
#endif /* ndef DRAWABLE_H_INCLUDED */
See more files for this project here