afxScriptEvent.cpp
Engine/source/afx/ce/afxScriptEvent.cpp
Public Defines
define
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxScriptEventData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Script Event <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "Arbitrary script functions can be called as an AFX effect using afxScriptEventData. They are useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> implementing " "high-level scripted side-effects such as character resurrection or teleportation." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )
Detailed Description
Public Defines
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxScriptEventData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Script Event <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "Arbitrary script functions can be called as an AFX effect using afxScriptEventData. They are useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> implementing " "high-level scripted side-effects such as character resurrection or teleportation." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )
IMPLEMENT_CO_DATABLOCK_V1(afxScriptEventData )
1 2 3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames 5// Copyright (C) 2015 Faust Logic, Inc. 6// 7// Permission is hereby granted, free of charge, to any person obtaining a copy 8// of this software and associated documentation files (the "Software"), to 9// deal in the Software without restriction, including without limitation the 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11// sell copies of the Software, and to permit persons to whom the Software is 12// furnished to do so, subject to the following conditions: 13// 14// The above copyright notice and this permission notice shall be included in 15// all copies or substantial portions of the Software. 16// 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23// IN THE SOFTWARE. 24// 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 26 27#include "afx/arcaneFX.h" 28 29#include "console/consoleTypes.h" 30#include "core/stream/bitStream.h" 31 32#include "afx/ce/afxScriptEvent.h" 33 34//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 35// afxScriptEventData 36 37IMPLEMENT_CO_DATABLOCK_V1(afxScriptEventData); 38 39ConsoleDocClass( afxScriptEventData, 40 "@brief A datablock that specifies a Script Event effect.\n\n" 41 42 "Arbitrary script functions can be called as an AFX effect using afxScriptEventData. They are useful for implementing " 43 "high-level scripted side-effects such as character resurrection or teleportation." 44 "\n\n" 45 46 "@ingroup afxEffects\n" 47 "@ingroup AFX\n" 48 "@ingroup Datablocks\n" 49); 50 51afxScriptEventData::afxScriptEventData() 52{ 53 method_name = ST_NULLSTRING; 54 script_data = ST_NULLSTRING; 55} 56 57afxScriptEventData::afxScriptEventData(const afxScriptEventData& other, bool temp_clone) : GameBaseData(other, temp_clone) 58{ 59 method_name = other.method_name; 60 script_data = other.script_data; 61} 62 63#define myOffset(field) Offset(field, afxScriptEventData) 64 65void afxScriptEventData::initPersistFields() 66{ 67 addField("methodName", TypeString, myOffset(method_name), 68 "The name of a script method defined for the instance class of an effects " 69 "choreographer. The arguments used to call this method are determined by the type " 70 "of choreographer."); 71 addField("scriptData", TypeString, myOffset(script_data), 72 "An arbitrary blind data value which is passed in as an argument of the script event " 73 "method. The value of scriptData can be used to differentiate uses when handling " 74 "different script event effects with a single method."); 75 76 Parent::initPersistFields(); 77} 78 79void afxScriptEventData::packData(BitStream* stream) 80{ 81 Parent::packData(stream); 82 83 stream->writeString(method_name); 84 stream->writeString(script_data); 85} 86 87void afxScriptEventData::unpackData(BitStream* stream) 88{ 89 Parent::unpackData(stream); 90 91 method_name = stream->readSTString(); 92 script_data = stream->readSTString(); 93} 94 95//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 96