我得到了一个奇怪的错误,说不能将类型转换为自己!
谁能告诉我这里有什么问题! ?
public ref class Weapon{
private :
int Slot_, Id_, Ammo_;
System::String^ Name_;
public :
Weapon(EWeapons Id, int Ammo) : Id_((int)Id), Ammo_(Ammo){}
Weapon(int Id, int Ammo) : Id_(Id), Ammo_(Ammo){}
//other part of code...
}
property OSamp::Weapon Weapon{
OSamp::Weapon get(){
return OSamp::Weapon(1, 1000);
// error C2440: 'return' : cannot convert from 'OSamp::Weapon' to 'OSamp::Weapon'
}
}