Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rf scratch #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Rf scratch #3

wants to merge 7 commits into from

Conversation

huixiong806
Copy link
Member

No description provided.

@huixiong806 huixiong806 reopened this Dec 17, 2019
@@ -3,15 +3,52 @@
#include <memory>
#include <vector>
#include "Object.hpp"

#include "Windows.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

The presence of the Windows.h include in headers will cause significant compile slow-down to all relevant files.

virtual void getMousePosition(Vec2d& pos)noexcept = 0;
virtual PlayerState GetPlayerStateInformation()noexcept = 0;
};
class GameConnectionTH10 : public GameConnection {
Copy link
Member

Choose a reason for hiding this comment

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

Implementation details of a unit should not be put in headers resembling an internal interface. Move it to CPP files instead.

void sendKeyInfo(int dir, bool shift, bool z, bool x) noexcept override;
void getMousePosition(Vec2d& pos)noexcept override;
int getTimeline() noexcept override;
PlayerState GetPlayerStateInformation()noexcept override;
Copy link
Member

Choose a reason for hiding this comment

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

Please apply naming conventions consistently if you decide to make any changes to that

@@ -12,7 +12,7 @@ namespace {
constexpr const char KEY_X = 88;
constexpr const char KEY_Z = 90;
constexpr const char KEY_ESCAPE = 90;
void sendKey(int key, bool down) noexcept {
void sendKey(int key, bool down) noexcept {
Copy link
Member

Choose a reason for hiding this comment

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

improper formatting.

#include <cstdlib>
#include <cstring>
#include <Windows.h>
/*
Copy link
Member

Choose a reason for hiding this comment

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

Same problem as above. You should NOT use windows-only APIs when the content can be easily implemented with ISO C++ contents.

pauseUntilPress("�뽫������ڷ���¼�����ϣ���ʼ��Ϸ��Ȼ��C����AI", 'C');
std::cout << "�ѿ�ʼ��Ϸ����P���ӡ���ͼ��Q���˳�" << std::endl;
pauseUntilPress("�뽫������ڷ���¼�����ϣ���ʼ��Ϸ����C����AI", 'C');
std::cout << "�ѿ�ʼ��Ϸ����C����/�ر������Q���˳�" << std::endl;
unsigned long long frameCount = 0;
StopWatch watch;
int mapOutputCount = 0;
Copy link
Member

Choose a reason for hiding this comment

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

inconsistent formatting

Copy link
Member

@DWVoid DWVoid left a comment

Choose a reason for hiding this comment

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

Please improve the quality of this pull request according to the comments.

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.

3 participants