CEL: Crystal Entity Layer: tools/questmanager.h Source File (CEL: Crystal Entity Layer Public API Reference)

| ## Public API Reference

- Main Page
- Classes
- Files

# tools/questmanager.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2004 by Jorrit Tyberghein
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018 */
    00019
    00020 #ifndef __CEL_MGR_QUEST__
    00021 #define __CEL_MGR_QUEST__
    00022
    00023 #include "cstypes.h"
    00024 #include "csutil/scf.h"
    00025 #include "csutil/hash.h"
    00026 #include "csgeom/vector3.h"
    00027
    00028 struct iDocumentNode;
    00029 struct iChangePropertyQuestRewardFactory;
    00030 struct iCelDataBuffer;
    00031 struct iQuest;
    00032
    00033 /*
    00034 <quest name="test">
    00035     <state name="notstarted">
    00036     </state>
    00037
    00038     <state name="start">
    00039         <trigger type="ininventory">
    00040             <fireon entity="$actor_entity" new_entity="computer_part" />
    00041             <reward type="newstate" state="state2" />
    00042             <reward type="increasestats" statname="HP" value="3" />
    00043         </trigger>
    00044         <trigger type="objectdestroyed">
    00045             <fireon entity="barrel" />
    00046             <reward type="newstate" state="finalstate" />
    00047             <reward type="increasestats" statname="HP" value="10" />
    00048         </trigger>
    00049     </state>
    00050
    00051     <state name="state2">
    00052         <trigger type="clickonentity">
    00053             <fireon entity="" />
    00054         </trigger>
    00055         <trigger type="cel.questtrigger.entersector">
    00056             <fireon entity="player" sector="room" />
    00057         </trigger>
    00058     </state>
    00059
    00060     <sequence name="seqTest">
    00061         <op type="movemesh" duration="2000" entity="door"
    00062                 x="0" y="4" z="0" />
    00063         <op type="lightcolor" duration="2000" entity="lightbulb"
    00064                 red="1" green="1" blue="1" />
    00065         <delay time="2000" />
    00066     </sequence>
    00067
    00068     <start>notstarted</start>
    00069 </quest>
    00070 */
    00071
    00072 typedef csHash<csStrKey,csStrKey> celQuestParams;
    00073
    00074 //-------------------------------------------------------------------------
    00075 // Triggers
    00076 //-------------------------------------------------------------------------
    00077
    00078 struct iQuestTrigger;
    00079
    00080 SCF_VERSION (iQuestTriggerCallback, 0, 0, 1);
    00081
    00088 struct iQuestTriggerCallback : public iBase
    00089 {
    00091   virtual void TriggerFired (iQuestTrigger* trigger) = 0;
    00092 };
    00093
    00094 SCF_VERSION (iQuestTrigger, 0, 0, 1);
    00095
    00108 struct iQuestTrigger : public iBase
    00109 {
    00114   virtual void RegisterCallback (iQuestTriggerCallback* callback) = 0;
    00115
    00119   virtual void ClearCallback () = 0;
    00120
    00124   virtual void ActivateTrigger () = 0;
    00125
    00129   virtual void DeactivateTrigger () = 0;
    00130
    00136   virtual bool Check () = 0;
    00137
    00143   virtual bool LoadAndActivateTrigger (iCelDataBuffer* databuf) = 0;
    00144
    00148   virtual void SaveTriggerState (iCelDataBuffer* databuf) = 0;
    00149 };
    00150
    00151 SCF_VERSION (iQuestTriggerFactory, 0, 0, 1);
    00152
    00157 struct iQuestTriggerFactory : public iBase
    00158 {
    00165   virtual csPtr<iQuestTrigger> CreateTrigger (iQuest* quest,
    00166         const celQuestParams& params) = 0;
    00167
    00173   virtual bool Load (iDocumentNode* node) = 0;
    00174 };
    00175
    00176 SCF_VERSION (iQuestTriggerType, 0, 0, 1);
    00177
    00185 struct iQuestTriggerType : public iBase
    00186 {
    00190   virtual const char* GetName () const = 0;
    00191
    00195   virtual csPtr<iQuestTriggerFactory> CreateTriggerFactory () = 0;
    00196 };
    00197
    00198 //-------------------------------------------------------------------------
    00199 // Rewards
    00200 //-------------------------------------------------------------------------
    00201
    00202 SCF_VERSION (iQuestReward, 0, 0, 1);
    00203
    00211 struct iQuestReward : public iBase
    00212 {
    00216   virtual void Reward () = 0;
    00217 };
    00218
    00219 SCF_VERSION (iQuestRewardFactory, 0, 0, 1);
    00220
    00225 struct iQuestRewardFactory : public iBase
    00226 {
    00233   virtual csPtr<iQuestReward> CreateReward (iQuest* quest,
    00234         const celQuestParams& params) = 0;
    00235
    00241   virtual bool Load (iDocumentNode* node) = 0;
    00242 };
    00243
    00244 SCF_VERSION (iQuestRewardType, 0, 0, 1);
    00245
    00253 struct iQuestRewardType : public iBase
    00254 {
    00258   virtual const char* GetName () const = 0;
    00259
    00263   virtual csPtr<iQuestRewardFactory> CreateRewardFactory () = 0;
    00264 };
    00265
    00266 //-------------------------------------------------------------------------
    00267 // Sequence operations
    00268 //-------------------------------------------------------------------------
    00269
    00270 SCF_VERSION (iQuestSeqOp, 0, 0, 1);
    00271
    00278 struct iQuestSeqOp : public iBase
    00279 {
    00286   virtual void Init () = 0;
    00287
    00291   virtual bool Load (iCelDataBuffer* databuf) = 0;
    00292
    00296   virtual void Save (iCelDataBuffer* databuf) = 0;
    00297
    00303   virtual void Do (float time) = 0;
    00304 };
    00305
    00306 SCF_VERSION (iQuestSeqOpFactory, 0, 0, 1);
    00307
    00312 struct iQuestSeqOpFactory : public iBase
    00313 {
    00319   virtual csPtr<iQuestSeqOp> CreateSeqOp (const celQuestParams& params) = 0;
    00320
    00326   virtual bool Load (iDocumentNode* node) = 0;
    00327 };
    00328
    00329 SCF_VERSION (iQuestSeqOpType, 0, 0, 1);
    00330
    00338 struct iQuestSeqOpType : public iBase
    00339 {
    00343   virtual const char* GetName () const = 0;
    00344
    00348   virtual csPtr<iQuestSeqOpFactory> CreateSeqOpFactory () = 0;
    00349 };
    00350
    00351 struct iQuestSequence;
    00352
    00353 SCF_VERSION (iQuestSequenceCallback, 0, 0, 1);
    00354
    00359 struct iQuestSequenceCallback : public iBase
    00360 {
    00362   virtual void SequenceFinished (iQuestSequence* sequence) = 0;
    00363 };
    00364
    00365 SCF_VERSION (iQuestSequence, 0, 0, 1);
    00366
    00370 struct iQuestSequence : public iBase
    00371 {
    00375   virtual const char* GetName () const = 0;
    00376
    00382   virtual bool Start (csTicks delay) = 0;
    00383
    00390   virtual void Finish () = 0;
    00391
    00397   virtual void Abort () = 0;
    00398
    00402   virtual bool IsRunning () = 0;
    00403
    00407   virtual void AddSequenceCallback (iQuestSequenceCallback* cb) = 0;
    00411   virtual void RemoveSequenceCallback (iQuestSequenceCallback* cb) = 0;
    00412 };
    00413
    00414 //-------------------------------------------------------------------------
    00415 // The Quest
    00416 //-------------------------------------------------------------------------
    00417
    00418 SCF_VERSION (iQuest, 0, 0, 1);
    00419
    00424 struct iQuest : public iBase
    00425 {
    00430   virtual bool SwitchState (const char* state) = 0;
    00431
    00435   virtual const char* GetCurrentState () const = 0;
    00436
    00442   virtual bool LoadState (const char* state, iCelDataBuffer* databuf) = 0;
    00443
    00448   virtual void SaveState (iCelDataBuffer* databuf) = 0;
    00449
    00453   virtual iQuestSequence* FindSequence (const char* name) = 0;
    00454 };
    00455
    00456 SCF_VERSION (iQuestTriggerResponseFactory, 0, 0, 1);
    00457
    00463 struct iQuestTriggerResponseFactory : public iBase
    00464 {
    00469   virtual void SetTriggerFactory (iQuestTriggerFactory* trigger_fact) = 0;
    00470
    00475   virtual void AddRewardFactory (iQuestRewardFactory* reward_fact) = 0;
    00476 };
    00477
    00478 SCF_VERSION (iQuestStateFactory, 0, 0, 1);
    00479
    00484 struct iQuestStateFactory : public iBase
    00485 {
    00489   virtual const char* GetName () const = 0;
    00490
    00494   virtual iQuestTriggerResponseFactory* CreateTriggerResponseFactory () = 0;
    00495 };
    00496
    00497 SCF_VERSION (iQuestSequenceFactory, 0, 0, 1);
    00498
    00503 struct iQuestSequenceFactory : public iBase
    00504 {
    00508   virtual const char* GetName () const = 0;
    00509
    00515   virtual bool Load (iDocumentNode* node) = 0;
    00516
    00524   virtual void AddSeqOpFactory (iQuestSeqOpFactory* seqopfact,
    00525         const char* duration) = 0;
    00526
    00531   virtual void AddDelay (const char* delay) = 0;
    00532 };
    00533
    00534 SCF_VERSION (iQuestFactory, 0, 0, 1);
    00535
    00550 struct iQuestFactory : public iBase
    00551 {
    00555   virtual const char* GetName () const = 0;
    00556
    00564   virtual csPtr<iQuest> CreateQuest (const celQuestParams& params) = 0;
    00565
    00571   virtual bool Load (iDocumentNode* node) = 0;
    00572
    00577   virtual iQuestStateFactory* GetState (const char* name) = 0;
    00578
    00583   virtual iQuestStateFactory* CreateState (const char* name) = 0;
    00584
    00589   virtual iQuestSequenceFactory* GetSequence (const char* name) = 0;
    00590
    00595   virtual iQuestSequenceFactory* CreateSequence (const char* name) = 0;
    00596 };
    00597
    00598 //-------------------------------------------------------------------------
    00599 // The Quest Manager
    00600 //-------------------------------------------------------------------------
    00601
    00602 SCF_VERSION (iQuestManager, 0, 0, 1);
    00603
    00609 struct iQuestManager : public iBase
    00610 {
    00638   virtual bool RegisterTriggerType (iQuestTriggerType* trigger) = 0;
    00639
    00644   virtual iQuestTriggerType* GetTriggerType (const char* name) = 0;
    00645
    00669   virtual bool RegisterRewardType (iQuestRewardType* trigger) = 0;
    00670
    00675   virtual iQuestRewardType* GetRewardType (const char* name) = 0;
    00676
    00696   virtual bool RegisterSeqOpType (iQuestSeqOpType* seqop) = 0;
    00697
    00702   virtual iQuestSeqOpType* GetSeqOpType (const char* name) = 0;
    00703
    00707   virtual iQuestFactory* GetQuestFactory (const char* name) = 0;
    00708
    00714   virtual iQuestFactory* CreateQuestFactory (const char* name) = 0;
    00715
    00723   virtual const char* ResolveParameter (
    00724         const celQuestParams& params,
    00725         const char* param) = 0;
    00726
    00732   virtual bool Load (iDocumentNode* node) = 0;
    00733
    00738   virtual iQuestRewardFactory* AddNewStateReward (
    00739         iQuestTriggerResponseFactory* response,
    00740         const char* entity_par, const char* state_par) = 0;
    00741
    00746   virtual iQuestRewardFactory* AddDebugPrintReward (
    00747         iQuestTriggerResponseFactory* response,
    00748         const char* msg_par) = 0;
    00749
    00754   virtual iQuestRewardFactory* AddInventoryReward (
    00755         iQuestTriggerResponseFactory* response,
    00756         const char* entity_par, const char* child_entity_par) = 0;
    00757
    00762   virtual iQuestRewardFactory* AddSequenceReward (
    00763         iQuestTriggerResponseFactory* response,
    00764         const char* entity_par, const char* sequence_par,
    00765         const char* delay_par) = 0;
    00766
    00771   virtual iQuestRewardFactory* AddSequenceFinishReward (
    00772         iQuestTriggerResponseFactory* response,
    00773         const char* entity_par, const char* sequence_par) = 0;
    00774
    00780   virtual iChangePropertyQuestRewardFactory* AddChangePropertyReward (
    00781         iQuestTriggerResponseFactory* response,
    00782         const char* entity_par, const char* prop_par) = 0;
    00783
    00788   virtual iQuestTriggerFactory* SetTimeoutTrigger (
    00789         iQuestTriggerResponseFactory* response,
    00790         const char* timeout_par) = 0;
    00791
    00796   virtual iQuestTriggerFactory* SetEnterSectorTrigger (
    00797         iQuestTriggerResponseFactory* response,
    00798         const char* entity_par, const char* sector_par) = 0;
    00799
    00804   virtual iQuestTriggerFactory* SetMeshEnterSectorTrigger (
    00805         iQuestTriggerResponseFactory* response,
    00806         const char* entity_par, const char* sector_par) = 0;
    00807
    00812   virtual iQuestTriggerFactory* SetSequenceFinishTrigger (
    00813         iQuestTriggerResponseFactory* response,
    00814         const char* entity_par, const char* sequence_par) = 0;
    00815
    00820   virtual iQuestTriggerFactory* SetPropertyChangeTrigger (
    00821         iQuestTriggerResponseFactory* response,
    00822         const char* entity_par, const char* prop_par,
    00823         const char* value_par) = 0;
    00824
    00829   virtual iQuestTriggerFactory* SetTriggerTrigger (
    00830         iQuestTriggerResponseFactory* response,
    00831         const char* entity_par, bool do_leave = false) = 0;
    00832 };
    00833
    00834 //-------------------------------------------------------------------------
    00835 // Specific trigger implementations.
    00836 //-------------------------------------------------------------------------
    00837
    00838 SCF_VERSION (iTimeoutQuestTriggerFactory, 0, 0, 1);
    00839
    00854 struct iTimeoutQuestTriggerFactory : public iBase
    00855 {
    00861   virtual void SetTimeoutParameter (const char* timeout_par) = 0;
    00862 };
    00863
    00864 SCF_VERSION (iPropertyChangeQuestTriggerFactory, 0, 0, 1);
    00865
    00886 struct iPropertyChangeQuestTriggerFactory : public iBase
    00887 {
    00896   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    00897
    00903   virtual void SetPropertyParameter (const char* prop) = 0;
    00904
    00909   virtual void SetValueParameter (const char* value) = 0;
    00910 };
    00911
    00912 SCF_VERSION (iMeshSelectQuestTriggerFactory, 0, 0, 1);
    00913
    00932 struct iMeshSelectQuestTriggerFactory : public iBase
    00933 {
    00942   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    00943 };
    00944
    00945 SCF_VERSION (iInventoryQuestTriggerFactory, 0, 0, 1);
    00946
    00966 struct iInventoryQuestTriggerFactory : public iBase
    00967 {
    00976   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    00977
    00983   virtual void SetChildEntityParameter (const char* child_entity) = 0;
    00984 };
    00985
    00986 SCF_VERSION (iEnterSectorQuestTriggerFactory, 0, 0, 1);
    00987
    01010 struct iEnterSectorQuestTriggerFactory : public iBase
    01011 {
    01020   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01021
    01028   virtual void SetSectorParameter (const char* sector) = 0;
    01029 };
    01030
    01031 SCF_VERSION (iSequenceFinishQuestTriggerFactory, 0, 0, 1);
    01032
    01052 struct iSequenceFinishQuestTriggerFactory : public iBase
    01053 {
    01062   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01063
    01069   virtual void SetSequenceParameter (const char* sequence) = 0;
    01070 };
    01071
    01091 struct iTriggerQuestTriggerFactory : public iBase
    01092 {
    01101   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01102
    01107   virtual void EnableLeave () = 0;
    01108 };
    01109
    01110 //-------------------------------------------------------------------------
    01111 // Specific reward implementations.
    01112 //-------------------------------------------------------------------------
    01113
    01114 SCF_VERSION (iDebugPrintQuestRewardFactory, 0, 0, 1);
    01115
    01130 struct iDebugPrintQuestRewardFactory : public iBase
    01131 {
    01136   virtual void SetMessageParameter (const char* msg) = 0;
    01137 };
    01138
    01139 SCF_VERSION (iNewStateQuestRewardFactory, 0, 0, 1);
    01140
    01159 struct iNewStateQuestRewardFactory : public iBase
    01160 {
    01167   virtual void SetStateParameter (const char* state) = 0;
    01168
    01177   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01178 };
    01179
    01180 SCF_VERSION (iChangePropertyQuestRewardFactory, 0, 0, 1);
    01181
    01208 struct iChangePropertyQuestRewardFactory : public iBase
    01209 {
    01216   virtual void SetEntityParameter (const char* entity) = 0;
    01217
    01227   virtual void SetPCParameter (const char* pc, const char* tag) = 0;
    01228
    01234   virtual void SetPropertyParameter (const char* prop) = 0;
    01235
    01240   virtual void SetStringParameter (const char* pstring) = 0;
    01241
    01246   virtual void SetLongParameter (const char* plong) = 0;
    01247
    01252   virtual void SetFloatParameter (const char* pfloat) = 0;
    01253
    01258   virtual void SetBoolParameter (const char* pbool) = 0;
    01259
    01264   virtual void SetDiffParameter (const char* pdiff) = 0;
    01265
    01269   virtual void SetToggle () = 0;
    01270 };
    01271
    01272 SCF_VERSION (iInventoryQuestRewardFactory, 0, 0, 1);
    01273
    01295 struct iInventoryQuestRewardFactory : public iBase
    01296 {
    01305   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01306
    01312   virtual void SetChildEntityParameter (const char* entity,
    01313         const char* tag = 0) = 0;
    01314
    01315 };
    01316
    01317 SCF_VERSION (iSequenceQuestRewardFactory, 0, 0, 1);
    01318
    01337 struct iSequenceQuestRewardFactory : public iBase
    01338 {
    01347   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01348
    01354   virtual void SetSequenceParameter (const char* sequence) = 0;
    01355
    01360   virtual void SetDelayParameter (const char* delay) = 0;
    01361 };
    01362
    01363 SCF_VERSION (iSequenceFinishQuestRewardFactory, 0, 0, 1);
    01364
    01382 struct iSequenceFinishQuestRewardFactory : public iBase
    01383 {
    01392   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01393
    01399   virtual void SetSequenceParameter (const char* sequence) = 0;
    01400 };
    01401
    01402 //-------------------------------------------------------------------------
    01403 // Specific sequence operation implementations.
    01404 //-------------------------------------------------------------------------
    01405
    01406 SCF_VERSION (iDebugPrintQuestSeqOpFactory, 0, 0, 1);
    01407
    01422 struct iDebugPrintQuestSeqOpFactory : public iBase
    01423 {
    01428   virtual void SetMessageParameter (const char* msg) = 0;
    01429 };
    01430
    01431 SCF_VERSION (iTransformQuestSeqOpFactory, 0, 0, 1);
    01432
    01458 struct iTransformQuestSeqOpFactory : public iBase
    01459 {
    01466   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01467
    01471   virtual void SetVectorParameter (const char* vectorx, const char* vectory,
    01472         const char* vectorz) = 0;
    01473
    01479   virtual void SetRotationParameter (int rot_axis, const char* rot_angle) = 0;
    01480 };
    01481
    01482 SCF_VERSION (iMovePathQuestSeqOpFactory, 0, 0, 1);
    01483
    01505 struct iMovePathQuestSeqOpFactory : public iBase
    01506 {
    01513   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01514
    01524   virtual void AddPathNode (const char* sectorname, const char* node,
    01525         const char* time) = 0;
    01526 };
    01527
    01528 SCF_VERSION (iLightQuestSeqOpFactory, 0, 0, 1);
    01529
    01552 struct iLightQuestSeqOpFactory : public iBase
    01553 {
    01560   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
    01561
    01565   virtual void SetRelColorParameter (const char* red, const char* green,
    01566         const char* blue) = 0;
    01567
    01571   virtual void SetAbsColorParameter (const char* red, const char* green,
    01572         const char* blue) = 0;
    01573 };
    01574
    01575 //-------------------------------------------------------------------------
    01576
    01580 #define CEL_DECLARE_REWARDTYPE(name,id)                                 \
    01581 class cel##name##RewardType : public iQuestRewardType                   \
    01582 {                                                                       \
    01583 public:                                                                 \
    01584   iObjectRegistry* object_reg;                                          \
    01585   cel##name##RewardType (iObjectRegistry* object_reg);                  \
    01586   virtual ~cel##name##RewardType ();                                    \
    01587   SCF_DECLARE_IBASE;                                                    \
    01588   virtual const char* GetName () const { return id; }                   \
    01589   virtual csPtr<iQuestRewardFactory> CreateRewardFactory ();            \
    01590 };
    01591
    01595 #define CEL_IMPLEMENT_REWARDTYPE(name)                                  \
    01596 SCF_IMPLEMENT_IBASE (cel##name##RewardType)                             \
    01597   SCF_IMPLEMENTS_INTERFACE (iQuestRewardType)                           \
    01598 SCF_IMPLEMENT_IBASE_END                                                 \
    01599 cel##name##RewardType::cel##name##RewardType (                          \
    01600         iObjectRegistry* object_reg)                                    \
    01601 {                                                                       \
    01602   SCF_CONSTRUCT_IBASE (0);                                              \
    01603   cel##name##RewardType::object_reg = object_reg;                       \
    01604 }                                                                       \
    01605 cel##name##RewardType::~cel##name##RewardType ()                        \
    01606 {                                                                       \
    01607   SCF_DESTRUCT_IBASE ();                                                \
    01608 }                                                                       \
    01609 csPtr<iQuestRewardFactory> cel##name##RewardType::CreateRewardFactory ()\
    01610 {                                                                       \
    01611   cel##name##RewardFactory* fact = new                                  \
    01612         cel##name##RewardFactory (this);                                \
    01613   return fact;                                                          \
    01614 }
    01615
    01619 #define CEL_DECLARE_TRIGGERTYPE(name,id)                                \
    01620 class cel##name##TriggerType : public iQuestTriggerType                 \
    01621 {                                                                       \
    01622 public:                                                                 \
    01623   iObjectRegistry* object_reg;                                          \
    01624   cel##name##TriggerType (iObjectRegistry* object_reg);                 \
    01625   virtual ~cel##name##TriggerType ();                                   \
    01626   SCF_DECLARE_IBASE;                                                    \
    01627   virtual const char* GetName () const { return id; }                   \
    01628   virtual csPtr<iQuestTriggerFactory> CreateTriggerFactory ();          \
    01629 };
    01630
    01634 #define CEL_IMPLEMENT_TRIGGERTYPE(name)                                 \
    01635 SCF_IMPLEMENT_IBASE (cel##name##TriggerType)                            \
    01636   SCF_IMPLEMENTS_INTERFACE (iQuestTriggerType)                          \
    01637 SCF_IMPLEMENT_IBASE_END                                                 \
    01638 cel##name##TriggerType::cel##name##TriggerType (                        \
    01639         iObjectRegistry* object_reg)                                    \
    01640 {                                                                       \
    01641   SCF_CONSTRUCT_IBASE (0);                                              \
    01642   cel##name##TriggerType::object_reg = object_reg;                      \
    01643 }                                                                       \
    01644 cel##name##TriggerType::~cel##name##TriggerType ()                      \
    01645 {                                                                       \
    01646   SCF_DESTRUCT_IBASE ();                                                \
    01647 }                                                                       \
    01648 csPtr<iQuestTriggerFactory> cel##name##TriggerType::CreateTriggerFactory () \
    01649 {                                                                       \
    01650   cel##name##TriggerFactory* fact = new cel##name##TriggerFactory (this); \
    01651   return fact;                                                          \
    01652 }
    01653
    01657 #define CEL_DECLARE_SEQOPTYPE(name,id)                                  \
    01658 class cel##name##SeqOpType : public iQuestSeqOpType                     \
    01659 {                                                                       \
    01660 public:                                                                 \
    01661   iObjectRegistry* object_reg;                                          \
    01662   cel##name##SeqOpType (iObjectRegistry* object_reg);                   \
    01663   virtual ~cel##name##SeqOpType ();                                     \
    01664   SCF_DECLARE_IBASE;                                                    \
    01665   virtual const char* GetName () const { return id; }                   \
    01666   virtual csPtr<iQuestSeqOpFactory> CreateSeqOpFactory ();              \
    01667 };
    01668
    01672 #define CEL_IMPLEMENT_SEQOPTYPE(name)                                   \
    01673 SCF_IMPLEMENT_IBASE (cel##name##SeqOpType)                              \
    01674   SCF_IMPLEMENTS_INTERFACE (iQuestSeqOpType)                            \
    01675 SCF_IMPLEMENT_IBASE_END                                                 \
    01676 cel##name##SeqOpType::cel##name##SeqOpType (                            \
    01677         iObjectRegistry* object_reg)                                    \
    01678 {                                                                       \
    01679   SCF_CONSTRUCT_IBASE (0);                                              \
    01680   cel##name##SeqOpType::object_reg = object_reg;                        \
    01681 }                                                                       \
    01682 cel##name##SeqOpType::~cel##name##SeqOpType ()                          \
    01683 {                                                                       \
    01684   SCF_DESTRUCT_IBASE ();                                                \
    01685 }                                                                       \
    01686 csPtr<iQuestSeqOpFactory> cel##name##SeqOpType::CreateSeqOpFactory ()   \
    01687 {                                                                       \
    01688   cel##name##SeqOpFactory* fact = new cel##name##SeqOpFactory (this);   \
    01689   return fact;                                                          \
    01690 }
    01691
    01692 #endif // __CEL_MGR_QUEST__
    01693