libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
field.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <string>
6#include <memory>
7
8#include "global.h"
9#include "spimpl.h"
10
11namespace libscratchcpp
12{
13
14class Entity;
15class Value;
16class FieldPrivate;
17
20{
21 public:
22 Field(const std::string &name, const Value &value, std::shared_ptr<Entity> valuePtr = nullptr);
23 Field(const std::string &name, const Value &value, const std::string &valueId);
24 Field(const std::string &name, const Value &value, const char *valueId);
25 Field(const Field &) = delete;
26
27 const std::string &name() const;
28
29 const Value &value() const;
30
31 std::shared_ptr<Entity> valuePtr() const;
32 void setValuePtr(const std::shared_ptr<Entity> &newValuePtr);
33
34 const std::string &valueId() const;
35
36 private:
37 spimpl::unique_impl_ptr<FieldPrivate> impl;
38};
39
40} // namespace libscratchcpp
The Entity class is the base class of everything that is identified by an ID (Target,...
Definition entity.h:17
const std::string & name() const
Definition field.cpp:29
const Value & value() const
Definition field.cpp:35
Field(const std::string &name, const Value &value, std::shared_ptr< Entity > valuePtr=nullptr)
Definition field.cpp:11
std::shared_ptr< Entity > valuePtr() const
Definition field.cpp:41
const std::string & valueId() const
Definition field.cpp:58
void setValuePtr(const std::shared_ptr< Entity > &newValuePtr)
Definition field.cpp:47
Field(const Field &)=delete
The Value class represents a Scratch value.
Definition value.h:22
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10