polserver/pol-core/bscript/bboolean.h
turleypol 1463b76c7c
Includes are now all relative to pol-core basefolder (#906)
* all except pol

* pol and includes under defines

* something weird has happened

* remove own folder from include searchpath

* fixed remaining, adapted include style for external headers

* missing include
2026-07-25 23:01:18 +02:00

39 lines
896 B
C++

#pragma once
#include "bscript/bobjectimp.h"
namespace Pol::Bscript
{
class BBoolean final : public BObjectImp
{
using base = BObjectImp;
public:
#if BOBJECTIMP_DEBUG
explicit BBoolean( bool bval = false );
BBoolean( const BBoolean& B );
#else
explicit BBoolean( bool bval = false ) : BObjectImp( OTBoolean ), bval_( bval ) {}
BBoolean( const BBoolean& B ) : BBoolean( B.bval_ ) {}
#endif
private:
~BBoolean() override = default;
public:
static BObjectImp* unpack( std::istream& is );
void packonto( std::string& os ) const override;
size_t sizeEstimate() const override;
bool value() const { return bval_; }
public: // Class Machinery
BObjectImp* copy() const override;
bool isTrue() const override;
bool operator==( const BObjectImp& objimp ) const override;
std::string getStringRep() const override;
private:
bool bval_;
};
} // namespace Pol::Bscript