Magic_Game/Easy2D/Object/Node.cpp

106 lines
1.0 KiB
C++
Raw Normal View History

2017-09-27 17:56:28 +08:00
#include "..\easy2d.h"
2017-09-10 23:56:52 +08:00
Node::Node() :
m_nZOrder(0),
2017-09-27 17:56:28 +08:00
m_bDisplay(true)
{
}
Node::Node(CPoint p) :
m_Pos(p)
2017-09-10 23:56:52 +08:00
{
}
Node::Node(int x, int y) :
m_nZOrder(0),
2017-09-27 17:56:28 +08:00
m_bDisplay(true)
2017-09-10 23:56:52 +08:00
{
}
Node::~Node()
{
}
bool Node::_exec(bool active)
{
return false;
}
void Node::_onDraw()
{
}
2017-09-27 17:56:28 +08:00
int Node::getX() const
{
return m_Pos.x;
}
int Node::getY() const
2017-09-10 23:56:52 +08:00
{
2017-09-27 17:56:28 +08:00
return m_Pos.y;
2017-09-10 23:56:52 +08:00
}
2017-09-27 17:56:28 +08:00
CPoint Node::getPos() const
2017-09-10 23:56:52 +08:00
{
2017-09-27 17:56:28 +08:00
return m_Pos;
2017-09-10 23:56:52 +08:00
}
void Node::setX(int x)
{
2017-09-27 17:56:28 +08:00
m_Pos.x = x;
2017-09-10 23:56:52 +08:00
}
void Node::setY(int y)
{
2017-09-27 17:56:28 +08:00
m_Pos.y = y;
2017-09-10 23:56:52 +08:00
}
void Node::setPos(int x, int y)
{
2017-09-27 17:56:28 +08:00
m_Pos.SetPoint(x, y);
}
void Node::setPos(CPoint p)
{
m_Pos = p;
2017-09-10 23:56:52 +08:00
}
void Node::move(int x, int y)
{
2017-09-27 17:56:28 +08:00
m_Pos.Offset(x, y);
}
void Node::move(CVector v)
{
m_Pos.Offset(v);
2017-09-10 23:56:52 +08:00
}
int Node::getZOrder() const
{
return m_nZOrder;
}
void Node::setZOrder(int z)
{
m_nZOrder = z;
}
Scene * Node::getParentScene()
{
return m_pScene;
}
void Node::setParentScene(Scene * scene)
{
m_pScene = scene;
}
void Node::setDisplay(bool value)
{
m_bDisplay = value;
}
bool Node::display() const
{
return m_bDisplay;
}