summaryrefslogtreecommitdiff
path: root/cObject.h
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-01-07 23:12:00 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-01-07 23:12:00 +0100
commit58d83d0394b81e079bfbb767936f7449235a236d (patch)
treeef7b06381893c82d73c91b52c83c6bd998d05243 /cObject.h
parent89de9d2f5d4a05eeefa2cc77e7a4f7dd48b31048 (diff)
downloadtermgl-58d83d0394b81e079bfbb767936f7449235a236d.tar.gz
added documentationv0.1
Diffstat (limited to 'cObject.h')
-rw-r--r--cObject.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/cObject.h b/cObject.h
index f9b42c4..a72b1cc 100644
--- a/cObject.h
+++ b/cObject.h
@@ -12,33 +12,49 @@ struct sObject
int sizeX;
int sizeY;
};
-
+/* cObject can be used standalone as well as inherited
+* every cObject has its own framebuffer as well as position viariables to be moveable.
+* cObject is used by cObjectHandler to manage all objects to be displayed
+*/
class cObject : public cRender
{
public:
+ /* Sets the size to _sx x _sy
+ */
cObject(int _sx, int _sy);
- //_sx : SizeX
- //_sy : SizeY
virtual ~cObject();
+ /** Returns current position
+ */
sPos getPosition();
+ /** Sets position to _pos
+ */
void setPosition(sPos _pos);
-
+ /** Sets position by coordinates
+ */
void setPosition(int _x, int _y);
+ /** Returns sObject with framebuffer and current position
+ */
sObject getObject();
+ /** Called by cObjecthandler if cObject is clicked
+ */
virtual void onClick(sPos _pos, unsigned int _button){}
-
+ /** Called by cObjecthandler if cObject is active on keyboard input
+ */
virtual void onChar(unsigned char _c){}
protected: //For child classes
cObject();
-
+ /** For inheriting classes: sets size of framebuffer
+ */
void setSize(int _sx, int _sy);
+ /** For inheriting classes: frees the framebuffer
+ */
void destruct();
private: