Open
Conversation
grayed
requested changes
Jun 6, 2022
| virtual const Pole* getPole(const std::string& name) const; | ||
|
|
||
| protected: | ||
| virtual const Pole* getPole(size_t idx) const; |
|
|
||
| virtual size_t getPoleCount() const { return 2; } | ||
|
|
||
| virtual const Pole* getPole(const std::string& name) const; |
Owner
There was a problem hiding this comment.
Эту функцию перереализовывать не требовалось.
electricy.cpp
Outdated
|
|
||
| return nullptr; | ||
| } | ||
| }; No newline at end of file |
Owner
There was a problem hiding this comment.
Нет main(), демонстрирующего создание цепи.
electricy.h
Outdated
| virtual const Pole* getPole(const std::string& name) const = 0; | ||
|
|
||
| virtual size_t getPoleCount() const = 0; | ||
| bool isConnectedTo(const Object& other) const; |
electricy.h
Outdated
|
|
||
| virtual size_t getPoleCount() const = 0; | ||
| bool isConnectedTo(const Object& other) const; | ||
| bool connect(const std::string& poleName, const Object& other, const std::string& otherPoleName); |
vector3d.cpp
Outdated
| v1[2] = 54; | ||
| //vector3d v4 = v1 + v2, v5 = v1 - v2, v6 = v1 * 0.5f; | ||
| //cout << "v4: " << v4 << endl << "v5: " << v5 << endl << "v6: " << v6 << endl; | ||
| class Vec { |
Owner
There was a problem hiding this comment.
Этот код должен был оказаться внутри изначально данного класса vector3d.
vector3d.cpp
Outdated
| Vec operator -(const Vec& other) { | ||
| return Vec(data[0] - other[0], data[1] - other[1], data[2] - other[2]); | ||
| }; | ||
| Vec operator *(const float value) { |
Owner
There was a problem hiding this comment.
Передаваемые по значению аргументы нет смысла делать const.
vector3d.cpp
Outdated
| }; | ||
| Vec operator !() { | ||
| if ((data[0] == 0) && (data[1] == 0) && (data[2] == 0)) | ||
| return Vec(data[0] == 1, data[1] == 1, data[2] == 1); |
vector3d.cpp
Outdated
| if ((data[0] == 0) && (data[1] == 0) && (data[2] == 0)) | ||
| return Vec(data[0] == 1, data[1] == 1, data[2] == 1); | ||
| else | ||
| return Vec(data[0] == 0, data[1] == 0, data[2] == 0); |
vector3d.cpp
Outdated
| }; | ||
|
|
||
| return 0; | ||
| bool test_Vec() { |
Owner
There was a problem hiding this comment.
Эта функция должна была быть отдельной, и её должна вызывать main().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.