Design mode code comments are changed to English

https://github.com/huihut/interview/pull/73
This commit is contained in:
huihut
2020-12-16 16:07:24 +08:00
parent 8fe5157ae3
commit 3a9e2123aa
21 changed files with 78 additions and 78 deletions

View File

@@ -8,43 +8,43 @@
#include "abstraction.h"
#include <iostream>
// 拉链式开关
// Zipper switch
class PullChainSwitch : public ISwitch
{
public:
PullChainSwitch(IElectricalEquipment *ee) : ISwitch(ee) {}
// 用拉链式开关打开电器
// Turn on the equipment with a zipper switch
virtual void On() override
{
std::cout << "Switch on the equipment with a pull chain switch." << std::endl;
std::cout << "Turn on the equipment with a zipper switch." << std::endl;
m_pEe->PowerOn();
}
// 用拉链式开关关闭电器
// Turn off the equipment with a zipper switch
virtual void Off() override
{
std::cout << "Switch off the equipment with a pull chain switch." << std::endl;
std::cout << "Turn off the equipment with a zipper switch." << std::endl;
m_pEe->PowerOff();
}
};
// 两位开关
// Two-position switch
class TwoPositionSwitch : public ISwitch
{
public:
TwoPositionSwitch(IElectricalEquipment *ee) : ISwitch(ee) {}
// 用两位开关打开电器
// Turn on the equipment with a two-position switch
virtual void On() override
{
std::cout << "Switch on the equipment with a two-position switch." << std::endl;
std::cout << "Turn on the equipment with a two-position switch." << std::endl;
m_pEe->PowerOn();
}
// 用两位开关关闭电器
// Turn off the equipment with a two-position switch
virtual void Off() override {
std::cout << "Switch off the equipment with a two-position switch." << std::endl;
std::cout << "Turn off the equipment with a two-position switch." << std::endl;
m_pEe->PowerOff();
}
};