本文整理汇总了C++中Computer::getAdditionalPartsList方法的典型用法代码示例。如果您正苦于以下问题:C++ Computer::getAdditionalPartsList方法的具体用法?C++ Computer::getAdditionalPartsList怎么用?C++ Computer::getAdditionalPartsList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer
的用法示例。
在下文中一共展示了Computer::getAdditionalPartsList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildGamingComputerTest3
bool buildGamingComputerTest3()
{
ComputerBuilder *builder = new GamingComputerBuilder();
builder->createComputer();
Computer *computer = builder->getResult();
Part** list = computer->getAdditionalPartsList();
for (int i = 0; i < computer->getNumberOfAdditionalParts(); ++i)
{
Part* part = list[i];
if (part != 0)
{
// tests if Part is a BluRay drive
if(dynamic_cast<BluRayDrive*>(part))
{
delete builder;
delete computer;
return true;
}
}
}
delete builder;
delete computer;
return false;
}
示例2: computerBluRayTest
bool computerBluRayTest()
{
Computer* computer = new Computer();
computer->setNumberOfAdditionalParts(1);
computer->addAdditionalPart(BluRayDrive("LG Black 12X BD-ROM", 12));
Part** parts = computer->getAdditionalPartsList();
std::string expected = "Blu-ray Drive: LG Black 12X BD-ROM, Read Speed: 12X";
std::string actual = std::string(parts[0]->getPartInformation());
delete computer;
return expected == actual;
}
示例3: computerFanTest
bool computerFanTest()
{
Computer* computer = new Computer();
computer->setNumberOfAdditionalParts(1);
computer->addAdditionalPart(CoolingFan("Cooler Master SickleFlow 120 - Sleeve Bearing 120mm", 1600));
Part** parts = computer->getAdditionalPartsList();
std::string expected = "Cooling Fan: Cooler Master SickleFlow 120 - Sleeve Bearing 120mm, Speed: 1600 RPM";
std::string actual = std::string(parts[0]->getPartInformation());
delete computer;
return expected == actual;
}
示例4: computerDVDDriveTest
bool computerDVDDriveTest()
{
Computer* computer = new Computer();
computer->setNumberOfAdditionalParts(1);
computer->addAdditionalPart(DVDDrive("ASUS 24X DVD Burner", 16));
Part** parts = computer->getAdditionalPartsList();
std::string expected = "DVD Drive: ASUS 24X DVD Burner, Read Speed: 16X";
std::string actual = std::string(parts[0]->getPartInformation());
delete computer;
return expected == actual;
}
示例5: computerWaterCoolingTest
bool computerWaterCoolingTest()
{
Computer* computer = new Computer();
computer->setNumberOfAdditionalParts(1);
computer->addAdditionalPart(WaterCooling("CORSAIR Hydro Series H50 120mm", "CPU Block"));
Part** parts = computer->getAdditionalPartsList();
std::string expected = "Water Cooler: CORSAIR Hydro Series H50 120mm, Cooling Type: CPU Block";
std::string actual = std::string(parts[0]->getPartInformation());
delete computer;
return expected == actual;
}