#include "Script.hpp" namespace Porygon{ const bool ScriptType::CanBeIndexedWith(ScriptType *indexer) const{ // String type is the only simple script type we want to return _class == TypeClass::String && indexer->_class == TypeClass::Number && !((NumericScriptType*)indexer)->IsFloat(); } const shared_ptr ScriptType::GetIndexedType(ScriptType *indexer) const{ if (_class == TypeClass::String){ return make_shared(TypeClass::String); } return make_shared(TypeClass::Error); } extern "C"{ ScriptType* CreateScriptType(Porygon::TypeClass t){ return new ScriptType(t); } ScriptType* CreateNumericScriptType(bool isAware, bool isFloat){ return new NumericScriptType(isAware, isFloat); } ScriptType* CreateStringScriptType(bool knownAtBind, uint32_t hash){ return new StringScriptType(knownAtBind, hash); } } }