Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "object.h"
- object::object(int x,int y,int k,int g)
- {
- x1=x;
- y1=y;
- kuan=k;
- gao=g;
- }
- object::object(object &b)
- {
- x1=b.x1;
- y1=b.y1;
- kuan=b.kuan;
- gao=b.gao;
- }
- object::~object()
- {
- }
- void object::update()
- {
- x2=x1+kuan;
- y2=y1+gao;
- }
- int object::getx1()
- {
- return x1;
- }
- int object::gety1()
- {
- return y1;
- }
- int object::getx2()
- {
- return x2;
- }
- int object::gety2()
- {
- return y2;
- }
- int object::getkuan()
- {
- return kuan;
- }
- int object::getgao()
- {
- return gao;
- }
- int object::getzhen()
- {
- return zhen;
- }
- void object::setinit(int x, int y, int k, int g)
- {
- x1=x;
- y1=y;
- kuan=k;
- gao=g;
- x2=x1+kuan;
- y2=y1+gao;
- }
- void object::setx1(int x)
- {
- x1=x;
- update();
- }
- void object::sety1(int y)
- {
- y1=y;
- update();
- }
- void object::setzhen(int z)
- {
- zhen=z;
- }
- void object::setgao(int g)
- {
- gao=g;
- update();
- }
- void object::setkuan(int k)
- {
- kuan=k;
- update();
- }
Advertisement
Add Comment
Please, Sign In to add comment