c++中,怎么在New_player.h文件中新增一个New_Player类,继承Player.h文件中的Player类的所有公共私有属性,并新增 //uint8 realRace; //npctrainer uint32 NpcTrainerId; //灵力 int32 SpiritPower; uint32 MaxSpiritPower; uint32 SpiritPowerTimer; uint32 SpiritPowerInterval; //假人 bool IsFaker; uint32 FakerMoveTimer; //faction uint32 faction; uint32 temp_faction; //rank uint32 rankValue; uint32 rankLevel; uint32 maxRankValue;这些属性?可否给出完整代码?
时间: 2023-03-15 20:50:16 浏览: 105
你可以使用以下代码在New_Player.h文件中新增一个New_Player类,继承Player.h文件中的Player类的所有公共私有属性,并新增 //uint8 realRace; //npctrainer uint32 NpcTrainerId; //灵力 int32 SpiritPower; uint32 MaxSpiritPower; uint32 SpiritPowerTimer; uint32 SpiritPowerInterval; //假人 bool IsFaker; uint32 FakerMoveTimer; //faction uint32 faction; uint32 temp_faction; //rank uint32 rankValue; uint32 rankLevel; uint32 maxRankValue;这些属性:class New_Player: public Player {
public:
uint8 realRace; //npctrainer
uint32 NpcTrainerId; //灵力
int32 SpiritPower;
uint32 MaxSpiritPower;
uint32 SpiritPowerTimer;
uint32 SpiritPowerInterval; //假人
bool IsFaker;
uint32 FakerMoveTimer; //faction
uint32 faction;
uint32 temp_faction; //rank
uint32 rankValue;
uint32 rankLevel;
uint32 maxRankValue;
};
阅读全文