baba-is-auto
C++17 Baba Is You simulator
Loading...
Searching...
No Matches
baba_is_auto::Object Class Reference

Object class. More...

#include <Object.hpp>

Public Member Functions

 Object ()=default
 Default constructor.
 
 Object (std::vector< ObjectType > types)
 
bool operator== (const Object &rhs) const
 
void Add (ObjectType type)
 
void Remove (ObjectType type)
 
std::vector< ObjectTypeGetTypes () const
 
bool HasType (ObjectType type) const
 
bool HasTextType () const
 
bool HasNounType () const
 
bool HasVerbType () const
 
bool HasPropertyType () const
 

Public Attributes

bool isRule = false
 Whether this object is part of an active rule.
 

Detailed Description

Object class.

This class represents objects such as nouns, operators, and properties. A noun is a word that corresponds to any possible in-game sprite. A few nouns like STAR have multiple corresponding sprites, while VIOLET and FLOWER words have the same corresponding sprites. A noun can be used as a NOUN IS VERB statement e.g. BABA IS YOU to give it a property or as a NOUN IS NOUN statement e.g. WALL IS WATER to turn an object into another object. An operator is a word that goes in between properties and nouns to show the relation between them. A property is something that can be attached to noun words to alter their behavior.

Constructor & Destructor Documentation

◆ Object() [1/2]

baba_is_auto::Object::Object ( )
default

Default constructor.

◆ Object() [2/2]

baba_is_auto::Object::Object ( std::vector< ObjectType types)
explicit

Constructs an object.

Parameters
typesA list of object types.

Member Function Documentation

◆ Add()

void baba_is_auto::Object::Add ( ObjectType  type)

Adds an object type.

Parameters
typeAn object type to add.

◆ GetTypes()

std::vector< ObjectType > baba_is_auto::Object::GetTypes ( ) const

Gets a list of object types, including duplicate stacked objects.

Returns
A list of object types.

◆ HasNounType()

bool baba_is_auto::Object::HasNounType ( ) const

Checks the object has noun type.

Returns
The flag indicates that the object has noun type.

◆ HasPropertyType()

bool baba_is_auto::Object::HasPropertyType ( ) const

Checks the object has property type.

Returns
The flag indicates that the object has property type.

◆ HasTextType()

bool baba_is_auto::Object::HasTextType ( ) const

Checks the object has text type.

Returns
The flag indicates that the object has text type.

◆ HasType()

bool baba_is_auto::Object::HasType ( ObjectType  type) const

Checks the object has specific type.

Parameters
typeAn object type to check.
Returns
The flag indicates that the object has specific type.

◆ HasVerbType()

bool baba_is_auto::Object::HasVerbType ( ) const

Checks the object has verb type.

Returns
The flag indicates that the object has verb type.

◆ operator==()

bool baba_is_auto::Object::operator== ( const Object rhs) const

Operator overloading for ==.

Parameters
rhsA right side of Object object.
Returns
The value that indicates two objects are equal.

◆ Remove()

void baba_is_auto::Object::Remove ( ObjectType  type)

Removes an object type.

Parameters
typeAn object type to remove.

Member Data Documentation

◆ isRule

bool baba_is_auto::Object::isRule = false

Whether this object is part of an active rule.


The documentation for this class was generated from the following file: