Skip to content

Pacman#3

Open
IrinaBaidina wants to merge 2 commits into
hBuzzy:masterfrom
IrinaBaidina:master
Open

Pacman#3
IrinaBaidina wants to merge 2 commits into
hBuzzy:masterfrom
IrinaBaidina:master

Conversation

@IrinaBaidina

Copy link
Copy Markdown

No description provided.

@hBuzzy hBuzzy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправить замечания.

Comment thread gamewindow.h
void updateGame();
void movePacman();
void checkCollision();
void paintEvent(QPaintEvent* event);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переопределенные методы лучше убрать в protected, как минимум.

Comment thread gamewindow.h Outdated
void drawGameArea(QPainter* painter);
void updateGame();
void movePacman();
void checkCollision();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check - почти всегда плохо в названии. Плюс сам метод - пустой.

Comment thread gamewindow.cpp Outdated
Comment on lines +18 to +37
void GameWindow::initializeGame() {

}

void GameWindow::drawGameArea(QPainter* painter) {

}

void GameWindow::updateGame() {
movePacman();
checkCollision();
update();
}

void GameWindow::movePacman() {
}

void GameWindow::checkCollision() {

}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для чего все пустые методы?

Comment thread pacmanarea/dragitem/abstractdragitem.h Outdated
Comment on lines +26 to +27
int WIDTH_ = 1;
int HEIGHT_ = 1;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protected поля именуем так же, как и приватные.

camelCase_

WIDTH_ -> width_ и т.д.


CoinDragItem::CoinDragItem(qreal x, qreal y, qreal boxSize) :
AbstractDragItem::AbstractDragItem(x, y, boxSize, DragItemFabric::getNameByType(DragItemFabric::COIN), Qt::yellow)
{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не переносим скобку


class DragItemFabric {
public:
enum DragItemType { VWALL, HWALL, COIN };

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перечисления в стиле констант kConstName

Comment thread pacmanarea/dragitem/walldragitem.cpp Outdated
Comment on lines +10 to +11
){
if(type == WallType::HORISONTAL){

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробелы перед {

Comment thread pacmanarea/dragitem/walldragitem.cpp Outdated
if(type == WallType::HORISONTAL){
qreal temp = WIDTH_;
WIDTH_ = HEIGHT_;
HEIGHT_ = temp;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temp - не общепринятое сокращение. Напишите полностью или замените на более конкретное название, если такое возможно.

Comment thread pacmanarea/dragitem/walldragitem.h Outdated

class WallDragItem : public AbstractDragItem {
public:
enum WallType { VERTICAL, HORISONTAL };

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перечисления в стиле констант kConstName

Comment thread pacmanarea/pacmanarea.h Outdated
Comment on lines +25 to +28
const int DEMO_BOX_SIZE_ = 20;
const int AREA_BOX_COUNT_ = 30;
const int ITEMS_FIELD_BOX_HEIGHT_COUNT_ = 5;
const int PRINT_ITEM_STEP = 5;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Константы именуем не в стиле макросов, а в стиле kConstName, т.е. префикс k + camelCase

@hBuzzy hBuzzy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Принято.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants