shape.cpp
来自「一个漂亮的万花筒游戏」· C++ 代码 · 共 44 行
CPP
44 行
// Shape.cpp: implementation of the Shape class.
//
//////////////////////////////////////////////////////////////////////
#include <assert.h>
#include "ezwin.h"
#include "WindowObject.h"
#include "Shape.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Shape::Shape(SimpleWindow &Window, const Position &p,
const color &c) : WindowObject(Window, p), Color(c),
Border(true) {
// No body needed
}
color Shape::GetColor() const {
return Color;
}
void Shape::SetColor(const color &c) {
assert(c >= 0 && c < MaxColors);
Color = c;
return;
}
void Shape::SetBorder() {
Border = true;
return;
}
void Shape::ClearBorder() {
Border = false;
return;
}
bool Shape::HasBorder() const {
return Border;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?