mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
18 lines
469 B
C++
18 lines
469 B
C++
#include "Fruit.h"
|
|
#include <sstream>
|
|
namespace demo {
|
|
|
|
Fruit::Fruit(const std::string& name) : _name(name) {}
|
|
|
|
Fruit::Fruit(const std::string& name, int price) : _name(name), _price(price) {}
|
|
|
|
std::string Fruit::fullInfo() const {
|
|
std::stringstream ss;
|
|
ss << "Full information about fruit " << _name << std::endl
|
|
<< " price: " << _price << std::endl
|
|
<< " sweetness: " << _sweetness << std::endl;
|
|
return ss.str();
|
|
}
|
|
|
|
} // namespace demo
|