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

@@ -9,10 +9,10 @@
void AdapterMain()
{
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Create a power adapter
IRussiaSocket * pAdapter = new PowerAdapter();
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Recharge
pAdapter->Charge();
SAFE_DELETE(pAdapter);

View File

@@ -7,7 +7,7 @@
#include <iostream>
// 自带的充电器(两脚扁型)
// Built-in charger (two-leg flat type)
class OwnCharger
{
public:

View File

@@ -12,7 +12,7 @@
#define SAFE_DELETE(p) { if(p){delete(p); (p)=NULL;} }
#endif
// 电源适配器
// Power Adapter
class PowerAdapter : public IRussiaSocket
{
public:
@@ -23,11 +23,11 @@ public:
}
void Charge()
{
// 使用自带的充电器(两脚扁形)充电
// Use the built-in charger (two-pin flat) to charge
m_pCharger->ChargeWithFeetFlat();
}
private:
// 持有需要被适配的接口对象(自带的充电器)
// Hold the interface object that needs to be adapted (the built-in charger)
OwnCharger* m_pCharger;
};

View File

@@ -5,11 +5,11 @@
#ifndef DESIGNPATTERN_TARGET_H
#define DESIGNPATTERN_TARGET_H
// 俄罗斯提供的插座
// Sockets provided by Russia
class IRussiaSocket
{
public:
// 使用双脚圆形充电(暂不实现)
// Use both feet to charge in a round shape (not implemented yet)
virtual void Charge() = 0;
};