mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-03 11:58:34 +02:00
change to Test API
This commit is contained in:
parent
5654acf5bf
commit
ddbadf5a69
4 changed files with 28 additions and 12 deletions
|
@ -311,6 +311,9 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE void copyToClipboard(const QString& text);
|
Q_INVOKABLE void copyToClipboard(const QString& text);
|
||||||
|
|
||||||
|
int getOtherAvatarsReplicaCount() { return DependencyManager::get<AvatarHashMap>()->getReplicaCount(); }
|
||||||
|
void setOtherAvatarsReplicaCount(int count) { DependencyManager::get<AvatarHashMap>()->setReplicaCount(count); }
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
void beforeEnterBackground();
|
void beforeEnterBackground();
|
||||||
void enterBackground();
|
void enterBackground();
|
||||||
|
|
|
@ -191,3 +191,11 @@ void TestScriptingInterface::saveObject(QVariant variant, const QString& filenam
|
||||||
void TestScriptingInterface::showMaximized() {
|
void TestScriptingInterface::showMaximized() {
|
||||||
qApp->getWindow()->showMaximized();
|
qApp->getWindow()->showMaximized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) {
|
||||||
|
qApp->setOtherAvatarsReplicaCount(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TestScriptingInterface::getOtherAvatarsReplicaCount() {
|
||||||
|
return qApp->getOtherAvatarsReplicaCount();
|
||||||
|
}
|
|
@ -149,6 +149,20 @@ public slots:
|
||||||
*/
|
*/
|
||||||
void showMaximized();
|
void showMaximized();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Values higher than 0 will create replicas of other-avatars when entering a domain for testing purpouses
|
||||||
|
* @function Test.setOtherAvatarsReplicaCount
|
||||||
|
* @param {number} count - Number of replicas we want to create
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE void setOtherAvatarsReplicaCount(int count);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Return the number of replicas that are being created of other-avatars when entering a domain
|
||||||
|
* @function Test.getOtherAvatarsReplicaCount
|
||||||
|
* @returns {number} Current number of replicas of other-avatars.
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE int getOtherAvatarsReplicaCount();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
||||||
QString _testResultsLocation;
|
QString _testResultsLocation;
|
||||||
|
|
|
@ -95,21 +95,12 @@ public:
|
||||||
// Null/Default-constructed QUuids will return MyAvatar
|
// Null/Default-constructed QUuids will return MyAvatar
|
||||||
Q_INVOKABLE virtual ScriptAvatarData* getAvatar(QUuid avatarID) { return new ScriptAvatarData(getAvatarBySessionID(avatarID)); }
|
Q_INVOKABLE virtual ScriptAvatarData* getAvatar(QUuid avatarID) { return new ScriptAvatarData(getAvatarBySessionID(avatarID)); }
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* @function AvatarList.setReplicaCount
|
|
||||||
* @param {number} count // The times an avatar will get replicated
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE void setReplicaCount(int count);
|
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* @function AvatarList.setReplicaCount
|
|
||||||
* @param {number} count // The times an avatar will get replicated
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE int getReplicaCount() { return _replicas.getReplicaCount(); };
|
|
||||||
|
|
||||||
virtual AvatarSharedPointer getAvatarBySessionID(const QUuid& sessionID) const { return findAvatar(sessionID); }
|
virtual AvatarSharedPointer getAvatarBySessionID(const QUuid& sessionID) const { return findAvatar(sessionID); }
|
||||||
int numberOfAvatarsInRange(const glm::vec3& position, float rangeMeters);
|
int numberOfAvatarsInRange(const glm::vec3& position, float rangeMeters);
|
||||||
|
|
||||||
|
void setReplicaCount(int count);
|
||||||
|
int getReplicaCount() { return _replicas.getReplicaCount(); };
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
|
Loading…
Reference in a new issue