garagedoor.hpp

来自「一个类似遥控器的源码程序。可以有多种功能」· HPP 代码 · 共 37 行

HPP
37
字号
#ifndef	_HEAD_FIRST_DESIGN_PATTERNS_COMMAND_REMOTE_GARAGE_DOOR_HPP_
#define _HEAD_FIRST_DESIGN_PATTERNS_COMMAND_REMOTE_GARAGE_DOOR_HPP_

#include "Remote.hpp"

namespace HeadFirstDesignPatterns {
namespace Command {
namespace Remote {class GarageDoor {	private: std::string location; 	public: GarageDoor(std::string location) {		this->location = location;	} 	public: virtual void up() {		std::cout << location.c_str() << " garage Door is Up" << std::endl;	} 	public: virtual void down() {		std::cout << location.c_str() << " garage Door is Down" << std::endl;	}	public: virtual void stop() {		std::cout << location.c_str() << " garage Door is Stopped" << std::endl;	}	public: virtual void lightOn() {		std::cout << location.c_str() << " garage light is on" << std::endl;	}	public: virtual void lightOff() {		std::cout << location.c_str() << " garage light is off" << std::endl;	}};} // namespace Remote
} // namespace Command
} // namespace HeadFirstDesignPatterns#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?