mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-25 12:25:52 -04:00
fdf31508b8
git-svn-id: svn://localhost@708 8062f311-0dae-4547-b526-b8ab9ac864a5
85 lines
2.4 KiB
C++
85 lines
2.4 KiB
C++
/** \file
|
|
* Game Develop
|
|
* 2008-2012 Florian Rival (Florian.Rival@gmail.com)
|
|
*/
|
|
#include "ExpressionMetadata.h"
|
|
#include "GDCore/CommonTools.h"
|
|
#include <string>
|
|
|
|
namespace gd
|
|
{
|
|
|
|
ExpressionMetadata::ExpressionMetadata(std::string extensionNamespace_) :
|
|
shown(true),
|
|
extensionNamespace(extensionNamespace_)
|
|
{
|
|
}
|
|
|
|
ExpressionMetadata & ExpressionMetadata::SetHidden()
|
|
{
|
|
shown = false;
|
|
return *this;
|
|
}
|
|
|
|
StrExpressionMetadata::StrExpressionMetadata(std::string extensionNamespace_) :
|
|
shown(true),
|
|
extensionNamespace(extensionNamespace_)
|
|
{
|
|
}
|
|
|
|
StrExpressionMetadata & StrExpressionMetadata::SetHidden()
|
|
{
|
|
shown = false;
|
|
return *this;
|
|
}
|
|
|
|
gd::ParameterMetadata & ExpressionMetadata::AddParameter(const std::string & type, const wxString & description, const std::string & optionalObjectType, bool parameterIsOptional)
|
|
{
|
|
gd::ParameterMetadata info;
|
|
info.type = type;
|
|
info.description = gd::ToString(description);
|
|
info.codeOnly = false;
|
|
info.optional = parameterIsOptional;
|
|
info.supplementaryInformation = optionalObjectType.empty() ? "" : extensionNamespace+optionalObjectType;
|
|
|
|
parameters.push_back(info);
|
|
return parameters.back();
|
|
}
|
|
|
|
gd::ParameterMetadata & ExpressionMetadata::AddCodeOnlyParameter(const std::string & type, const std::string & supplementaryInformation)
|
|
{
|
|
gd::ParameterMetadata info;
|
|
info.type = type;
|
|
info.codeOnly = true;
|
|
info.supplementaryInformation = supplementaryInformation;
|
|
|
|
parameters.push_back(info);
|
|
return parameters.back();
|
|
}
|
|
|
|
gd::ParameterMetadata & StrExpressionMetadata::AddParameter(const std::string & type, const wxString & description, const std::string & optionalObjectType, bool parameterIsOptional)
|
|
{
|
|
gd::ParameterMetadata info;
|
|
info.type = type;
|
|
info.description = gd::ToString(description);
|
|
info.codeOnly = false;
|
|
info.optional = parameterIsOptional;
|
|
info.supplementaryInformation = optionalObjectType.empty() ? "" : extensionNamespace+optionalObjectType;
|
|
|
|
parameters.push_back(info);
|
|
return parameters.back();
|
|
}
|
|
|
|
gd::ParameterMetadata & StrExpressionMetadata::AddCodeOnlyParameter(const std::string & type, const std::string & supplementaryInformation)
|
|
{
|
|
gd::ParameterMetadata info;
|
|
info.type = type;
|
|
info.codeOnly = true;
|
|
info.supplementaryInformation = supplementaryInformation;
|
|
|
|
parameters.push_back(info);
|
|
return parameters.back();
|
|
}
|
|
|
|
}
|