/* * server/zone/objects/cell/CellObject.cpp generated by engine3 IDL compiler 0.60 */ #include "CellObject.h" #include "server/zone/objects/creature/CreatureObject.h" #include "server/zone/Zone.h" #include "server/zone/templates/SharedObjectTemplate.h" /* * CellObjectStub */ enum {RPC_SETALLOWENTRYPERMISSIONGROUP__STRING_,RPC_NOTIFYLOADFROMDATABASE__,RPC_SENDCONTAINEROBJECTSTO__SCENEOBJECT_,RPC_SENDPERMISSIONSTO__CREATUREOBJECT_BOOL_,RPC_CANADDOBJECT__SCENEOBJECT_INT_STRING_,RPC_TRANSFEROBJECT__SCENEOBJECT_INT_BOOL_,RPC_INITIALIZETRANSIENTMEMBERS__,RPC_SENDBASELINESTO__SCENEOBJECT_,RPC_GETCURRENTNUMBEROFPLAYERITEMS__,RPC_DESTROYALLPLAYERITEMS__,RPC_GETCELLNUMBER__,RPC_SETCELLNUMBER__INT_,RPC_ISCELLOBJECT__}; CellObject::CellObject() : SceneObject(DummyConstructorParameter::instance()) { CellObjectImplementation* _implementation = new CellObjectImplementation(); _impl = _implementation; _impl->_setStub(this); _setClassName("CellObject"); } CellObject::CellObject(DummyConstructorParameter* param) : SceneObject(param) { _setClassName("CellObject"); } CellObject::~CellObject() { } void CellObject::loadTemplateData(SharedObjectTemplate* templateData) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->loadTemplateData(templateData); } void CellObject::setAllowEntryPermissionGroup(const String& group) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETALLOWENTRYPERMISSIONGROUP__STRING_); method.addAsciiParameter(group); method.executeWithVoidReturn(); } else _implementation->setAllowEntryPermissionGroup(group); } void CellObject::notifyLoadFromDatabase() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYLOADFROMDATABASE__); method.executeWithVoidReturn(); } else _implementation->notifyLoadFromDatabase(); } void CellObject::sendContainerObjectsTo(SceneObject* player) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDCONTAINEROBJECTSTO__SCENEOBJECT_); method.addObjectParameter(player); method.executeWithVoidReturn(); } else _implementation->sendContainerObjectsTo(player); } void CellObject::sendPermissionsTo(CreatureObject* object, bool allowEntry) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDPERMISSIONSTO__CREATUREOBJECT_BOOL_); method.addObjectParameter(object); method.addBooleanParameter(allowEntry); method.executeWithVoidReturn(); } else _implementation->sendPermissionsTo(object, allowEntry); } int CellObject::canAddObject(SceneObject* object, int containmentType, String& errorDescription) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CANADDOBJECT__SCENEOBJECT_INT_STRING_); method.addObjectParameter(object); method.addSignedIntParameter(containmentType); method.addAsciiParameter(errorDescription); return method.executeWithSignedIntReturn(); } else return _implementation->canAddObject(object, containmentType, errorDescription); } bool CellObject::transferObject(SceneObject* object, int containmentType, bool notifyClient) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_TRANSFEROBJECT__SCENEOBJECT_INT_BOOL_); method.addObjectParameter(object); method.addSignedIntParameter(containmentType); method.addBooleanParameter(notifyClient); return method.executeWithBooleanReturn(); } else return _implementation->transferObject(object, containmentType, notifyClient); } void CellObject::initializeTransientMembers() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_INITIALIZETRANSIENTMEMBERS__); method.executeWithVoidReturn(); } else _implementation->initializeTransientMembers(); } void CellObject::sendBaselinesTo(SceneObject* player) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDBASELINESTO__SCENEOBJECT_); method.addObjectParameter(player); method.executeWithVoidReturn(); } else _implementation->sendBaselinesTo(player); } int CellObject::getCurrentNumberOfPlayerItems() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETCURRENTNUMBEROFPLAYERITEMS__); return method.executeWithSignedIntReturn(); } else return _implementation->getCurrentNumberOfPlayerItems(); } void CellObject::destroyAllPlayerItems() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_DESTROYALLPLAYERITEMS__); method.executeWithVoidReturn(); } else _implementation->destroyAllPlayerItems(); } int CellObject::getCellNumber() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETCELLNUMBER__); return method.executeWithSignedIntReturn(); } else return _implementation->getCellNumber(); } void CellObject::setCellNumber(int number) { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETCELLNUMBER__INT_); method.addSignedIntParameter(number); method.executeWithVoidReturn(); } else _implementation->setCellNumber(number); } bool CellObject::isCellObject() { CellObjectImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISCELLOBJECT__); return method.executeWithBooleanReturn(); } else return _implementation->isCellObject(); } DistributedObjectServant* CellObject::_getImplementation() { if (!_updated) _updated = true; return _impl; } DistributedObjectServant* CellObject::_getImplementationForRead() { return _impl; } void CellObject::_setImplementation(DistributedObjectServant* servant) { _impl = servant; } /* * CellObjectImplementation */ CellObjectImplementation::CellObjectImplementation(DummyConstructorParameter* param) : SceneObjectImplementation(param) { _initializeImplementation(); } CellObjectImplementation::~CellObjectImplementation() { } void CellObjectImplementation::finalize() { } void CellObjectImplementation::_initializeImplementation() { _setClassHelper(CellObjectHelper::instance()); _this = NULL; _serializationHelperMethod(); } void CellObjectImplementation::_setStub(DistributedObjectStub* stub) { _this = static_cast(stub); SceneObjectImplementation::_setStub(stub); } DistributedObjectStub* CellObjectImplementation::_getStub() { return _this.get(); } CellObjectImplementation::operator const CellObject*() { return _this.get(); } void CellObjectImplementation::lock(bool doLock) { _this.getReferenceUnsafeStaticCast()->lock(doLock); } void CellObjectImplementation::lock(ManagedObject* obj) { _this.getReferenceUnsafeStaticCast()->lock(obj); } void CellObjectImplementation::rlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->rlock(doLock); } void CellObjectImplementation::wlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->wlock(doLock); } void CellObjectImplementation::wlock(ManagedObject* obj) { _this.getReferenceUnsafeStaticCast()->wlock(obj); } void CellObjectImplementation::unlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->unlock(doLock); } void CellObjectImplementation::runlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->runlock(doLock); } void CellObjectImplementation::_serializationHelperMethod() { SceneObjectImplementation::_serializationHelperMethod(); _setClassName("CellObject"); } void CellObjectImplementation::readObject(ObjectInputStream* stream) { uint16 _varCount = stream->readShort(); for (int i = 0; i < _varCount; ++i) { uint32 _nameHashCode; TypeInfo::parseFromBinaryStream(&_nameHashCode, stream); uint32 _varSize = stream->readInt(); int _currentOffset = stream->getOffset(); if(CellObjectImplementation::readObjectMember(stream, _nameHashCode)) { } stream->setOffset(_currentOffset + _varSize); } initializeTransientMembers(); } bool CellObjectImplementation::readObjectMember(ObjectInputStream* stream, const uint32& nameHashCode) { if (SceneObjectImplementation::readObjectMember(stream, nameHashCode)) return true; switch(nameHashCode) { case 0xb76efa57: //CellObject.cellNumber TypeInfo::parseFromBinaryStream(&cellNumber, stream); return true; case 0xef88f25a: //CellObject.currentNumberOfItems TypeInfo::parseFromBinaryStream(¤tNumberOfItems, stream); return true; } return false; } void CellObjectImplementation::writeObject(ObjectOutputStream* stream) { int _currentOffset = stream->getOffset(); stream->writeShort(0); int _varCount = CellObjectImplementation::writeObjectMembers(stream); stream->writeShort(_currentOffset, _varCount); } int CellObjectImplementation::writeObjectMembers(ObjectOutputStream* stream) { int _count = SceneObjectImplementation::writeObjectMembers(stream); uint32 _nameHashCode; int _offset; uint32 _totalSize; _nameHashCode = 0xb76efa57; //CellObject.cellNumber TypeInfo::toBinaryStream(&_nameHashCode, stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&cellNumber, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _nameHashCode = 0xef88f25a; //CellObject.currentNumberOfItems TypeInfo::toBinaryStream(&_nameHashCode, stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(¤tNumberOfItems, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); return _count + 2; } CellObjectImplementation::CellObjectImplementation() { _initializeImplementation(); // server/zone/objects/cell/CellObject.idl(): Logger.setLoggingName("CellObject"); Logger::setLoggingName("CellObject"); // server/zone/objects/cell/CellObject.idl(): cellNumber = 0; cellNumber = 0; // server/zone/objects/cell/CellObject.idl(): currentNumberOfItems = 0; currentNumberOfItems = 0; } void CellObjectImplementation::setAllowEntryPermissionGroup(const String& group) { // server/zone/objects/cell/CellObject.idl(): super.setContainerInheritPermissionsFromParent(false); SceneObjectImplementation::setContainerInheritPermissionsFromParent(false); // server/zone/objects/cell/CellObject.idl(): super.setContainerDefaultDenyPermission(ContainerPermissions.WALKIN); SceneObjectImplementation::setContainerDefaultDenyPermission(ContainerPermissions::WALKIN); // server/zone/objects/cell/CellObject.idl(): super.setContainerAllowPermission(group, ContainerPermissions.WALKIN); SceneObjectImplementation::setContainerAllowPermission(group, ContainerPermissions::WALKIN); } int CellObjectImplementation::getCellNumber() { // server/zone/objects/cell/CellObject.idl(): return cellNumber; return cellNumber; } void CellObjectImplementation::setCellNumber(int number) { // server/zone/objects/cell/CellObject.idl(): cellNumber = number; cellNumber = number; } bool CellObjectImplementation::isCellObject() { // server/zone/objects/cell/CellObject.idl(): return true; return true; } /* * CellObjectAdapter */ #include "engine/orb/messages/InvokeMethodMessage.h" CellObjectAdapter::CellObjectAdapter(CellObject* obj) : SceneObjectAdapter(obj) { } void CellObjectAdapter::invokeMethod(uint32 methid, DistributedMethod* inv) { DOBMessage* resp = inv->getInvocationMessage(); switch (methid) { case RPC_SETALLOWENTRYPERMISSIONGROUP__STRING_: { String group; setAllowEntryPermissionGroup(inv->getAsciiParameter(group)); } break; case RPC_NOTIFYLOADFROMDATABASE__: { notifyLoadFromDatabase(); } break; case RPC_SENDCONTAINEROBJECTSTO__SCENEOBJECT_: { sendContainerObjectsTo(static_cast(inv->getObjectParameter())); } break; case RPC_SENDPERMISSIONSTO__CREATUREOBJECT_BOOL_: { sendPermissionsTo(static_cast(inv->getObjectParameter()), inv->getBooleanParameter()); } break; case RPC_CANADDOBJECT__SCENEOBJECT_INT_STRING_: { String errorDescription; resp->insertSignedInt(canAddObject(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter(), inv->getAsciiParameter(errorDescription))); } break; case RPC_TRANSFEROBJECT__SCENEOBJECT_INT_BOOL_: { resp->insertBoolean(transferObject(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter(), inv->getBooleanParameter())); } break; case RPC_INITIALIZETRANSIENTMEMBERS__: { initializeTransientMembers(); } break; case RPC_SENDBASELINESTO__SCENEOBJECT_: { sendBaselinesTo(static_cast(inv->getObjectParameter())); } break; case RPC_GETCURRENTNUMBEROFPLAYERITEMS__: { resp->insertSignedInt(getCurrentNumberOfPlayerItems()); } break; case RPC_DESTROYALLPLAYERITEMS__: { destroyAllPlayerItems(); } break; case RPC_GETCELLNUMBER__: { resp->insertSignedInt(getCellNumber()); } break; case RPC_SETCELLNUMBER__INT_: { setCellNumber(inv->getSignedIntParameter()); } break; case RPC_ISCELLOBJECT__: { resp->insertBoolean(isCellObject()); } break; default: throw Exception("Method does not exists"); } } void CellObjectAdapter::setAllowEntryPermissionGroup(const String& group) { (static_cast(stub))->setAllowEntryPermissionGroup(group); } void CellObjectAdapter::notifyLoadFromDatabase() { (static_cast(stub))->notifyLoadFromDatabase(); } void CellObjectAdapter::sendContainerObjectsTo(SceneObject* player) { (static_cast(stub))->sendContainerObjectsTo(player); } void CellObjectAdapter::sendPermissionsTo(CreatureObject* object, bool allowEntry) { (static_cast(stub))->sendPermissionsTo(object, allowEntry); } int CellObjectAdapter::canAddObject(SceneObject* object, int containmentType, String& errorDescription) { return (static_cast(stub))->canAddObject(object, containmentType, errorDescription); } bool CellObjectAdapter::transferObject(SceneObject* object, int containmentType, bool notifyClient) { return (static_cast(stub))->transferObject(object, containmentType, notifyClient); } void CellObjectAdapter::initializeTransientMembers() { (static_cast(stub))->initializeTransientMembers(); } void CellObjectAdapter::sendBaselinesTo(SceneObject* player) { (static_cast(stub))->sendBaselinesTo(player); } int CellObjectAdapter::getCurrentNumberOfPlayerItems() { return (static_cast(stub))->getCurrentNumberOfPlayerItems(); } void CellObjectAdapter::destroyAllPlayerItems() { (static_cast(stub))->destroyAllPlayerItems(); } int CellObjectAdapter::getCellNumber() { return (static_cast(stub))->getCellNumber(); } void CellObjectAdapter::setCellNumber(int number) { (static_cast(stub))->setCellNumber(number); } bool CellObjectAdapter::isCellObject() { return (static_cast(stub))->isCellObject(); } /* * CellObjectHelper */ CellObjectHelper* CellObjectHelper::staticInitializer = CellObjectHelper::instance(); CellObjectHelper::CellObjectHelper() { className = "CellObject"; Core::getObjectBroker()->registerClass(className, this); } void CellObjectHelper::finalizeHelper() { CellObjectHelper::finalize(); } DistributedObject* CellObjectHelper::instantiateObject() { return new CellObject(DummyConstructorParameter::instance()); } DistributedObjectServant* CellObjectHelper::instantiateServant() { return new CellObjectImplementation(); } DistributedObjectAdapter* CellObjectHelper::createAdapter(DistributedObjectStub* obj) { DistributedObjectAdapter* adapter = new CellObjectAdapter(static_cast(obj)); obj->_setClassName(className); obj->_setClassHelper(this); adapter->setStub(obj); return adapter; } const char LuaCellObject::className[] = "LuaCellObject"; Luna::RegType LuaCellObject::Register[] = { { "_setObject", &LuaCellObject::_setObject }, { "_getObject", &LuaCellObject::_getObject }, { "loadTemplateData", &LuaCellObject::loadTemplateData }, { "setAllowEntryPermissionGroup", &LuaCellObject::setAllowEntryPermissionGroup }, { "notifyLoadFromDatabase", &LuaCellObject::notifyLoadFromDatabase }, { "sendContainerObjectsTo", &LuaCellObject::sendContainerObjectsTo }, { "sendPermissionsTo", &LuaCellObject::sendPermissionsTo }, { "canAddObject", &LuaCellObject::canAddObject }, { "transferObject", &LuaCellObject::transferObject }, { "initializeTransientMembers", &LuaCellObject::initializeTransientMembers }, { "sendBaselinesTo", &LuaCellObject::sendBaselinesTo }, { "getCurrentNumberOfPlayerItems", &LuaCellObject::getCurrentNumberOfPlayerItems }, { "destroyAllPlayerItems", &LuaCellObject::destroyAllPlayerItems }, { "getCellNumber", &LuaCellObject::getCellNumber }, { "setCellNumber", &LuaCellObject::setCellNumber }, { "isCellObject", &LuaCellObject::isCellObject }, { 0, 0 } }; LuaCellObject::LuaCellObject(lua_State *L) { realObject = static_cast(lua_touserdata(L, 1)); } LuaCellObject::~LuaCellObject() { } int LuaCellObject::_setObject(lua_State* L) { realObject = static_cast(lua_touserdata(L, -1)); return 0; } int LuaCellObject::_getObject(lua_State* L) { lua_pushlightuserdata(L, realObject.get()); return 1; } int LuaCellObject::loadTemplateData(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isuserdata(L, -1)) { if (parameterCount == 1) { SharedObjectTemplate* templateData = static_cast(lua_touserdata(L, -1)); realObject->loadTemplateData(templateData); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:loadTemplateData(userdata)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:loadTemplateData(userdata)'"); } } int LuaCellObject::setAllowEntryPermissionGroup(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isstring(L, -1)) { if (parameterCount == 1) { const String group = lua_tostring(L, -1); realObject->setAllowEntryPermissionGroup(group); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:setAllowEntryPermissionGroup(string)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:setAllowEntryPermissionGroup(string)'"); } } int LuaCellObject::notifyLoadFromDatabase(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { realObject->notifyLoadFromDatabase(); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:notifyLoadFromDatabase()'"); } } int LuaCellObject::sendContainerObjectsTo(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isuserdata(L, -1)) { if (parameterCount == 1) { SceneObject* player = static_cast(lua_touserdata(L, -1)); realObject->sendContainerObjectsTo(player); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:sendContainerObjectsTo(userdata)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:sendContainerObjectsTo(userdata)'"); } } int LuaCellObject::sendPermissionsTo(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isboolean(L, -1)) { if (lua_isuserdata(L, -2)) { if (parameterCount == 2) { CreatureObject* object = static_cast(lua_touserdata(L, -2)); bool allowEntry = lua_toboolean(L, -1); realObject->sendPermissionsTo(object, allowEntry); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:sendPermissionsTo(userdata, boolean)'"); } } else { throw LuaCallbackException(L, "invalid argument at 1 for lua method 'CellObject:sendPermissionsTo(userdata, boolean)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:sendPermissionsTo(userdata, boolean)'"); } } int LuaCellObject::canAddObject(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isstring(L, -1)) { if (lua_isnumber(L, -2)) { if (lua_isuserdata(L, -3)) { if (parameterCount == 3) { SceneObject* object = static_cast(lua_touserdata(L, -3)); int containmentType = lua_tointeger(L, -2); String errorDescription = lua_tostring(L, -1); int result = realObject->canAddObject(object, containmentType, errorDescription); lua_pushinteger(L, result); return 1; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:canAddObject(userdata, integer, string)'"); } } else { throw LuaCallbackException(L, "invalid argument at 2 for lua method 'CellObject:canAddObject(userdata, integer, string)'"); } } else { throw LuaCallbackException(L, "invalid argument at 1 for lua method 'CellObject:canAddObject(userdata, integer, string)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:canAddObject(userdata, integer, string)'"); } } int LuaCellObject::transferObject(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isboolean(L, -1)) { if (lua_isnumber(L, -2)) { if (lua_isuserdata(L, -3)) { if (parameterCount == 3) { SceneObject* object = static_cast(lua_touserdata(L, -3)); int containmentType = lua_tointeger(L, -2); bool notifyClient = lua_toboolean(L, -1); bool result = realObject->transferObject(object, containmentType, notifyClient); lua_pushboolean(L, result); return 1; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:transferObject(userdata, integer, boolean)'"); } } else { throw LuaCallbackException(L, "invalid argument at 2 for lua method 'CellObject:transferObject(userdata, integer, boolean)'"); } } else { throw LuaCallbackException(L, "invalid argument at 1 for lua method 'CellObject:transferObject(userdata, integer, boolean)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:transferObject(userdata, integer, boolean)'"); } } int LuaCellObject::initializeTransientMembers(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { realObject->initializeTransientMembers(); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:initializeTransientMembers()'"); } } int LuaCellObject::sendBaselinesTo(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isuserdata(L, -1)) { if (parameterCount == 1) { SceneObject* player = static_cast(lua_touserdata(L, -1)); realObject->sendBaselinesTo(player); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:sendBaselinesTo(userdata)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:sendBaselinesTo(userdata)'"); } } int LuaCellObject::getCurrentNumberOfPlayerItems(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { int result = realObject->getCurrentNumberOfPlayerItems(); lua_pushinteger(L, result); return 1; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:getCurrentNumberOfPlayerItems()'"); } } int LuaCellObject::destroyAllPlayerItems(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { realObject->destroyAllPlayerItems(); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:destroyAllPlayerItems()'"); } } int LuaCellObject::getCellNumber(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { int result = realObject->getCellNumber(); lua_pushinteger(L, result); return 1; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:getCellNumber()'"); } } int LuaCellObject::setCellNumber(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (lua_isnumber(L, -1)) { if (parameterCount == 1) { int number = lua_tointeger(L, -1); realObject->setCellNumber(number); return 0; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:setCellNumber(integer)'"); } } else { throw LuaCallbackException(L, "invalid argument at 0 for lua method 'CellObject:setCellNumber(integer)'"); } } int LuaCellObject::isCellObject(lua_State *L) { int parameterCount = lua_gettop(L) - 1; if (parameterCount == 0) { bool result = realObject->isCellObject(); lua_pushboolean(L, result); return 1; } else { throw LuaCallbackException(L, "invalid argument count " + String::valueOf(parameterCount) + " for lua method 'CellObject:isCellObject()'"); } }