Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/scripting/MessageTypeConversions.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 276 Lines • ▼ Show 20 Lines | |||||
JS::Value CMessageTerrainChanged::ToJSVal(const ScriptInterface& scriptInterface) const | JS::Value CMessageTerrainChanged::ToJSVal(const ScriptInterface& scriptInterface) const | ||||
{ | { | ||||
TOJSVAL_SETUP(); | TOJSVAL_SETUP(); | ||||
SET_MSG_PROPERTY(i0); | SET_MSG_PROPERTY(i0); | ||||
SET_MSG_PROPERTY(j0); | SET_MSG_PROPERTY(j0); | ||||
SET_MSG_PROPERTY(i1); | SET_MSG_PROPERTY(i1); | ||||
SET_MSG_PROPERTY(j1); | SET_MSG_PROPERTY(j1); | ||||
return OBJECT_TO_JSVAL(obj); | return JS::ObjectValue(*obj); | ||||
} | } | ||||
CMessage* CMessageTerrainChanged::FromJSVal(const ScriptInterface& scriptInterface, JS::HandleValue val) | CMessage* CMessageTerrainChanged::FromJSVal(const ScriptInterface& scriptInterface, JS::HandleValue val) | ||||
{ | { | ||||
FROMJSVAL_SETUP(); | FROMJSVAL_SETUP(); | ||||
GET_MSG_PROPERTY(int32_t, i0); | GET_MSG_PROPERTY(int32_t, i0); | ||||
GET_MSG_PROPERTY(int32_t, j0); | GET_MSG_PROPERTY(int32_t, j0); | ||||
GET_MSG_PROPERTY(int32_t, i1); | GET_MSG_PROPERTY(int32_t, i1); | ||||
Show All 23 Lines | CMessage* CMessageVisibilityChanged::FromJSVal(const ScriptInterface& scriptInterface, JS::HandleValue val) | ||||
return new CMessageVisibilityChanged(player, ent, oldVisibility, newVisibility); | return new CMessageVisibilityChanged(player, ent, oldVisibility, newVisibility); | ||||
} | } | ||||
//////////////////////////////// | //////////////////////////////// | ||||
JS::Value CMessageWaterChanged::ToJSVal(const ScriptInterface& scriptInterface) const | JS::Value CMessageWaterChanged::ToJSVal(const ScriptInterface& scriptInterface) const | ||||
{ | { | ||||
TOJSVAL_SETUP(); | TOJSVAL_SETUP(); | ||||
return OBJECT_TO_JSVAL(obj); | return JS::ObjectValue(*obj); | ||||
} | } | ||||
CMessage* CMessageWaterChanged::FromJSVal(const ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) | CMessage* CMessageWaterChanged::FromJSVal(const ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) | ||||
{ | { | ||||
return new CMessageWaterChanged(); | return new CMessageWaterChanged(); | ||||
} | } | ||||
//////////////////////////////// | //////////////////////////////// | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator