This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/src/eoDrawable.h
1999-02-08 16:13:26 +00:00

47 lines
1.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// eoDrawable.h
// (c) GeNeura Team, 1999
//-----------------------------------------------------------------------------
#ifndef EODRAWABLE_H
#define EODRAWABLE_H
//-----------------------------------------------------------------------------
using namespace std;
//-----------------------------------------------------------------------------
// eoDrawable
//-----------------------------------------------------------------------------
/** eoDrawable is a template class that adds a drawing interface to an object.\\
Requisites for template instantiation are that the object must admit a default ctor
and a copy ctor. The Object must be an eoObject, thus, it must have its methods: className,
eoDrawables can be drawn on any two-dimensional surface; it can be added to any
object with above characteristics.
@see eoObject
*/
template <class Object>
class eoDrawable
{
public:
/// Main ctor from an already built Object.
eoDrawable( const Object& _o): Object( _o ){};
/// Copy constructor.
eoDrawable( const eoDrawable& _d): Object( _d ){};
/// Virtual dtor. They are needed in virtual class hierarchies
virtual ~eoDrawable() {};
/**Draws the object. It must be redefined in any subclass, it´s impossible
to have a general drawing method
@param _x, _y coorinates */
virtual void draw( unsigned _x, unsigned _y) = 0;
};
#endif EODRAWABLE_H