mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
32 lines
942 B
C++
32 lines
942 B
C++
//
|
|
// EntityItemID.cpp
|
|
// libraries/entities/src
|
|
//
|
|
// Created by Brad Hefta-Gaub on 12/4/13.
|
|
// Copyright 2013 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QDebug>
|
|
|
|
#include "EntityItemID.h"
|
|
|
|
QScriptValue EntityItemIDtoScriptValue(QScriptEngine* engine, const EntityItemID& id) {
|
|
QScriptValue obj = engine->newObject();
|
|
obj.setProperty("id", id.id);
|
|
obj.setProperty("creatorTokenID", id.creatorTokenID);
|
|
obj.setProperty("isKnownID", id.isKnownID);
|
|
return obj;
|
|
}
|
|
|
|
void EntityItemIDfromScriptValue(const QScriptValue &object, EntityItemID& id) {
|
|
id.id = object.property("id").toVariant().toUInt();
|
|
id.creatorTokenID = object.property("creatorTokenID").toVariant().toUInt();
|
|
id.isKnownID = object.property("isKnownID").toVariant().toBool();
|
|
}
|
|
|
|
|
|
|