-
Notifications
You must be signed in to change notification settings - Fork 48
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
КМБО-03-21 Чертков Глеб #34
base: master
Are you sure you want to change the base?
Conversation
|
||
|
||
protected: | ||
Mammal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не сделано: конструкторы, сразу инициализирующие поля.
/// </summary> | ||
class Object { | ||
std::string name; | ||
static Pole* getNewInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему не подошёл просто конструктор?
{ | ||
// TODO | ||
return false; | ||
if (_connectedId == pole.getId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нет сигнализации об ошибке привязки.
return _connectedId; | ||
} | ||
|
||
bool Pole::send(const std::string& command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o_O
return nullptr; | ||
} | ||
|
||
const Pole* Switch::getPole(size_t idx) const | ||
Pole* Object::getPoleConnectedTo(const Object& object) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Несколько полюсов одного объекта могут быть соединены с несколькими полюсами другого. Простейший пример: батарейка [+] - лампочка - [-] батарейка. Смысл существования данной функции в этом случае не ясен.
{ | ||
os << "a_s: " << a_s << " b_s: " << getBString() << " data[] = {"; | ||
for (int i = 0; i < 7; ++i) { | ||
os << ((float*) ((std::string*) (this + 1) + 1))[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему ((this + 1) + 1)
?
Я не очень понял Вашу реализацию electricity, так что вся структура была изменена.
Вкратце об изменениях:
Пример кода:
Вывод:
А еще бонус: пикча с котиком