baba-is-auto
C++17 Baba Is You simulator
Loading...
Searching...
No Matches
Object.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2026 Chris Ohk
2
3// I am making my contributions/submissions to this project solely in our
4// personal capacity and am not conveying any rights to any intellectual
5// property of any third parties.
6
7#ifndef BABA_IS_AUTO_NOUN_HPP
8#define BABA_IS_AUTO_NOUN_HPP
9
11
12#include <map>
13#include <vector>
14
15namespace baba_is_auto
16{
31class Object
32{
33 public:
35 Object() = default;
36
39 explicit Object(std::vector<ObjectType> types);
40
44 bool operator==(const Object& rhs) const;
45
48 void Add(ObjectType type);
49
52 void Remove(ObjectType type);
53
56 std::vector<ObjectType> GetTypes() const;
57
61 bool HasType(ObjectType type) const;
62
65 bool HasTextType() const;
66
69 bool HasNounType() const;
70
73 bool HasVerbType() const;
74
77 bool HasPropertyType() const;
78
80 bool isRule = false;
81
82 private:
83 std::map<ObjectType, std::size_t> m_types;
84};
85} // namespace baba_is_auto
86
87#endif
Object class.
Definition Object.hpp:32
bool HasVerbType() const
bool isRule
Whether this object is part of an active rule.
Definition Object.hpp:80
Object(std::vector< ObjectType > types)
bool operator==(const Object &rhs) const
void Add(ObjectType type)
bool HasPropertyType() const
void Remove(ObjectType type)
Object()=default
Default constructor.
bool HasNounType() const
bool HasTextType() const
std::vector< ObjectType > GetTypes() const
bool HasType(ObjectType type) const
Definition IAgent.hpp:14
ObjectType
An enumerator for identifying the object.
Definition GameEnums.hpp:14