CEL

Public API Reference

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 
00601   virtual const char* GetDefaultParameter (const char* name) const = 0;
00602 
00607   virtual void SetDefaultParameter (const char* name,const char* value) = 0;
00608   
00612   virtual void ClearDefaultParameters () = 0;
00613 
00614 };
00615 
00616 //-------------------------------------------------------------------------
00617 // The Quest Manager
00618 //-------------------------------------------------------------------------
00619 
00620 SCF_VERSION (iQuestManager, 0, 0, 1);
00621 
00627 struct iQuestManager : public iBase
00628 {
00656   virtual bool RegisterTriggerType (iQuestTriggerType* trigger) = 0;
00657 
00662   virtual iQuestTriggerType* GetTriggerType (const char* name) = 0;
00663 
00693   virtual bool RegisterRewardType (iQuestRewardType* trigger) = 0;
00694 
00699   virtual iQuestRewardType* GetRewardType (const char* name) = 0;
00700 
00720   virtual bool RegisterSeqOpType (iQuestSeqOpType* seqop) = 0;
00721 
00726   virtual iQuestSeqOpType* GetSeqOpType (const char* name) = 0;
00727 
00731   virtual iQuestFactory* GetQuestFactory (const char* name) = 0;
00732 
00738   virtual iQuestFactory* CreateQuestFactory (const char* name) = 0;
00739 
00747   virtual const char* ResolveParameter (
00748         const celQuestParams& params,
00749         const char* param) = 0;
00750 
00756   virtual bool Load (iDocumentNode* node) = 0;
00757 
00762   virtual iQuestRewardFactory* AddNewStateReward (
00763         iQuestTriggerResponseFactory* response,
00764         const char* entity_par, const char* state_par) = 0;
00765 
00770   virtual iQuestRewardFactory* AddDebugPrintReward (
00771         iQuestTriggerResponseFactory* response,
00772         const char* msg_par) = 0;
00773 
00778   virtual iQuestRewardFactory* AddInventoryReward (
00779         iQuestTriggerResponseFactory* response,
00780         const char* entity_par, const char* child_entity_par) = 0;
00781 
00786   virtual iQuestRewardFactory* AddSequenceReward (
00787         iQuestTriggerResponseFactory* response,
00788         const char* entity_par, const char* sequence_par,
00789         const char* delay_par) = 0;
00790 
00795   virtual iQuestRewardFactory* AddSequenceFinishReward (
00796         iQuestTriggerResponseFactory* response,
00797         const char* entity_par, const char* sequence_par) = 0;
00798 
00804   virtual iChangePropertyQuestRewardFactory* AddChangePropertyReward (
00805         iQuestTriggerResponseFactory* response,
00806         const char* entity_par, const char* prop_par) = 0;
00807 
00812   virtual iQuestTriggerFactory* SetTimeoutTrigger (
00813         iQuestTriggerResponseFactory* response,
00814         const char* timeout_par) = 0;
00815 
00820   virtual iQuestTriggerFactory* SetEnterSectorTrigger (
00821         iQuestTriggerResponseFactory* response,
00822         const char* entity_par, const char* sector_par) = 0;
00823 
00828   virtual iQuestTriggerFactory* SetMeshEnterSectorTrigger (
00829         iQuestTriggerResponseFactory* response,
00830         const char* entity_par, const char* sector_par) = 0;
00831 
00836   virtual iQuestTriggerFactory* SetSequenceFinishTrigger (
00837         iQuestTriggerResponseFactory* response,
00838         const char* entity_par, const char* sequence_par) = 0;
00839 
00844   virtual iQuestTriggerFactory* SetPropertyChangeTrigger (
00845         iQuestTriggerResponseFactory* response,
00846         const char* entity_par, const char* prop_par,
00847         const char* value_par) = 0;
00848 
00853   virtual iQuestTriggerFactory* SetTriggerTrigger (
00854         iQuestTriggerResponseFactory* response,
00855         const char* entity_par, bool do_leave = false) = 0;
00856 };
00857 
00858 //-------------------------------------------------------------------------
00859 // Specific trigger implementations.
00860 //-------------------------------------------------------------------------
00861 
00862 SCF_VERSION (iTimeoutQuestTriggerFactory, 0, 0, 1);
00863 
00878 struct iTimeoutQuestTriggerFactory : public iBase
00879 {
00885   virtual void SetTimeoutParameter (const char* timeout_par) = 0;
00886 };
00887 
00888 SCF_VERSION (iPropertyChangeQuestTriggerFactory, 0, 0, 1);
00889 
00912 struct iPropertyChangeQuestTriggerFactory : public iBase
00913 {
00922   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
00923 
00929   virtual void SetPropertyParameter (const char* prop) = 0;
00930 
00937   virtual void SetValueParameter (const char* value) = 0;
00938 };
00939 
00940 SCF_VERSION (iMeshSelectQuestTriggerFactory, 0, 0, 1);
00941 
00960 struct iMeshSelectQuestTriggerFactory : public iBase
00961 {
00970   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
00971 };
00972 
00973 SCF_VERSION (iInventoryQuestTriggerFactory, 0, 0, 1);
00974 
00996 struct iInventoryQuestTriggerFactory : public iBase
00997 {
01006   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01007 
01015   virtual void SetChildEntityParameter (const char* child_entity) = 0;
01016 };
01017 
01018 SCF_VERSION (iEnterSectorQuestTriggerFactory, 0, 0, 1);
01019 
01042 struct iEnterSectorQuestTriggerFactory : public iBase
01043 {
01052   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01053 
01060   virtual void SetSectorParameter (const char* sector) = 0;
01061 };
01062 
01063 SCF_VERSION (iSequenceFinishQuestTriggerFactory, 0, 0, 1);
01064 
01084 struct iSequenceFinishQuestTriggerFactory : public iBase
01085 {
01094   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01095 
01101   virtual void SetSequenceParameter (const char* sequence) = 0;
01102 };
01103 
01123 struct iTriggerQuestTriggerFactory : public iBase
01124 {
01133   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01134 
01139   virtual void EnableLeave () = 0;
01140 };
01141 
01142 //-------------------------------------------------------------------------
01143 // Specific reward implementations.
01144 //-------------------------------------------------------------------------
01145 
01146 SCF_VERSION (iDebugPrintQuestRewardFactory, 0, 0, 1);
01147 
01162 struct iDebugPrintQuestRewardFactory : public iBase
01163 {
01168   virtual void SetMessageParameter (const char* msg) = 0;
01169 };
01170 
01171 SCF_VERSION (iNewStateQuestRewardFactory, 0, 0, 1);
01172 
01191 struct iNewStateQuestRewardFactory : public iBase
01192 {
01199   virtual void SetStateParameter (const char* state) = 0;
01200 
01209   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01210 };
01211 
01212 SCF_VERSION (iChangePropertyQuestRewardFactory, 0, 0, 1);
01213 
01240 struct iChangePropertyQuestRewardFactory : public iBase
01241 {
01248   virtual void SetEntityParameter (const char* entity) = 0;
01249 
01259   virtual void SetPCParameter (const char* pc, const char* tag) = 0;
01260 
01266   virtual void SetPropertyParameter (const char* prop) = 0;
01267 
01272   virtual void SetStringParameter (const char* pstring) = 0;
01273 
01278   virtual void SetLongParameter (const char* plong) = 0;
01279 
01284   virtual void SetFloatParameter (const char* pfloat) = 0;
01285 
01290   virtual void SetBoolParameter (const char* pbool) = 0;
01291 
01296   virtual void SetDiffParameter (const char* pdiff) = 0;
01297 
01301   virtual void SetToggle () = 0;
01302 };
01303 
01304 SCF_VERSION (iInventoryQuestRewardFactory, 0, 0, 1);
01305 
01327 struct iInventoryQuestRewardFactory : public iBase
01328 {
01337   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01338 
01344   virtual void SetChildEntityParameter (const char* entity,
01345         const char* tag = 0) = 0;
01346 
01347 };
01348 
01349 SCF_VERSION (iSequenceQuestRewardFactory, 0, 0, 1);
01350 
01369 struct iSequenceQuestRewardFactory : public iBase
01370 {
01379   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01380 
01386   virtual void SetSequenceParameter (const char* sequence) = 0;
01387 
01392   virtual void SetDelayParameter (const char* delay) = 0;
01393 };
01394 
01395 SCF_VERSION (iSequenceFinishQuestRewardFactory, 0, 0, 1);
01396 
01414 struct iSequenceFinishQuestRewardFactory : public iBase
01415 {
01424   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01425 
01431   virtual void SetSequenceParameter (const char* sequence) = 0;
01432 };
01433 
01449 struct iMessageQuestRewardFactory : public iBase
01450 {
01456   virtual void SetEntityParameter (const char* entity) = 0;
01457 
01462   virtual void SetIDParameter (const char* id) = 0;
01463 
01473   virtual void AddParameter (celDataType type, csStringID id,
01474       const char* name, const char* value) = 0;
01475 };
01476 
01494 struct iActionQuestRewardFactory : public iBase
01495 {
01501   virtual void SetEntityParameter (const char* entity) = 0;
01502 
01507   virtual void SetIDParameter (const char* id) = 0;
01508 
01514   virtual void SetPropertyClassParameter (const char* propertyclass) = 0;
01515 
01521   virtual void SetTagParameter (const char* tag) = 0;
01522 
01532   virtual void AddParameter (celDataType type, csStringID id,
01533       const char* name, const char* value) = 0;
01534 };
01535 
01549 struct iDestroyEntityQuestRewardFactory : public iBase
01550 {
01556   virtual void SetEntityParameter (const char* entity) = 0;
01557 };
01558 
01559 
01560 //-------------------------------------------------------------------------
01561 // Specific sequence operation implementations.
01562 //-------------------------------------------------------------------------
01563 
01564 SCF_VERSION (iDebugPrintQuestSeqOpFactory, 0, 0, 1);
01565 
01580 struct iDebugPrintQuestSeqOpFactory : public iBase
01581 {
01586   virtual void SetMessageParameter (const char* msg) = 0;
01587 };
01588 
01589 SCF_VERSION (iTransformQuestSeqOpFactory, 0, 0, 1);
01590 
01616 struct iTransformQuestSeqOpFactory : public iBase
01617 {
01624   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01625 
01629   virtual void SetVectorParameter (const char* vectorx, const char* vectory,
01630         const char* vectorz) = 0;
01631 
01637   virtual void SetRotationParameter (int rot_axis, const char* rot_angle) = 0;
01638 };
01639 
01640 SCF_VERSION (iMovePathQuestSeqOpFactory, 0, 0, 1);
01641 
01663 struct iMovePathQuestSeqOpFactory : public iBase
01664 {
01671   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01672 
01682   virtual void AddPathNode (const char* sectorname, const char* node,
01683         const char* time) = 0;
01684 };
01685 
01686 SCF_VERSION (iLightQuestSeqOpFactory, 0, 0, 1);
01687 
01710 struct iLightQuestSeqOpFactory : public iBase
01711 {
01718   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01719 
01723   virtual void SetRelColorParameter (const char* red, const char* green,
01724         const char* blue) = 0;
01725 
01729   virtual void SetAbsColorParameter (const char* red, const char* green,
01730         const char* blue) = 0;
01731 };
01732 
01733 //-------------------------------------------------------------------------
01734 
01738 #define CEL_DECLARE_REWARDTYPE(name,id)                                 \
01739 class cel##name##RewardType : public iQuestRewardType                   \
01740 {                                                                       \
01741 public:                                                                 \
01742   iObjectRegistry* object_reg;                                          \
01743   cel##name##RewardType (iObjectRegistry* object_reg);                  \
01744   virtual ~cel##name##RewardType ();                                    \
01745   SCF_DECLARE_IBASE;                                                    \
01746   virtual const char* GetName () const { return id; }                   \
01747   virtual csPtr<iQuestRewardFactory> CreateRewardFactory ();            \
01748 };
01749 
01753 #define CEL_IMPLEMENT_REWARDTYPE(name)                                  \
01754 SCF_IMPLEMENT_IBASE (cel##name##RewardType)                             \
01755   SCF_IMPLEMENTS_INTERFACE (iQuestRewardType)                           \
01756 SCF_IMPLEMENT_IBASE_END                                                 \
01757 cel##name##RewardType::cel##name##RewardType (                          \
01758         iObjectRegistry* object_reg)                                    \
01759 {                                                                       \
01760   SCF_CONSTRUCT_IBASE (0);                                              \
01761   cel##name##RewardType::object_reg = object_reg;                       \
01762 }                                                                       \
01763 cel##name##RewardType::~cel##name##RewardType ()                        \
01764 {                                                                       \
01765   SCF_DESTRUCT_IBASE ();                                                \
01766 }                                                                       \
01767 csPtr<iQuestRewardFactory> cel##name##RewardType::CreateRewardFactory ()\
01768 {                                                                       \
01769   cel##name##RewardFactory* fact = new                                  \
01770         cel##name##RewardFactory (this);                                \
01771   return fact;                                                          \
01772 }
01773 
01777 #define CEL_DECLARE_TRIGGERTYPE(name,id)                                \
01778 class cel##name##TriggerType : public iQuestTriggerType                 \
01779 {                                                                       \
01780 public:                                                                 \
01781   iObjectRegistry* object_reg;                                          \
01782   cel##name##TriggerType (iObjectRegistry* object_reg);                 \
01783   virtual ~cel##name##TriggerType ();                                   \
01784   SCF_DECLARE_IBASE;                                                    \
01785   virtual const char* GetName () const { return id; }                   \
01786   virtual csPtr<iQuestTriggerFactory> CreateTriggerFactory ();          \
01787 };
01788 
01792 #define CEL_IMPLEMENT_TRIGGERTYPE(name)                                 \
01793 SCF_IMPLEMENT_IBASE (cel##name##TriggerType)                            \
01794   SCF_IMPLEMENTS_INTERFACE (iQuestTriggerType)                          \
01795 SCF_IMPLEMENT_IBASE_END                                                 \
01796 cel##name##TriggerType::cel##name##TriggerType (                        \
01797         iObjectRegistry* object_reg)                                    \
01798 {                                                                       \
01799   SCF_CONSTRUCT_IBASE (0);                                              \
01800   cel##name##TriggerType::object_reg = object_reg;                      \
01801 }                                                                       \
01802 cel##name##TriggerType::~cel##name##TriggerType ()                      \
01803 {                                                                       \
01804   SCF_DESTRUCT_IBASE ();                                                \
01805 }                                                                       \
01806 csPtr<iQuestTriggerFactory> cel##name##TriggerType::CreateTriggerFactory () \
01807 {                                                                       \
01808   cel##name##TriggerFactory* fact = new cel##name##TriggerFactory (this); \
01809   return fact;                                                          \
01810 }
01811 
01815 #define CEL_DECLARE_SEQOPTYPE(name,id)                                  \
01816 class cel##name##SeqOpType : public iQuestSeqOpType                     \
01817 {                                                                       \
01818 public:                                                                 \
01819   iObjectRegistry* object_reg;                                          \
01820   cel##name##SeqOpType (iObjectRegistry* object_reg);                   \
01821   virtual ~cel##name##SeqOpType ();                                     \
01822   SCF_DECLARE_IBASE;                                                    \
01823   virtual const char* GetName () const { return id; }                   \
01824   virtual csPtr<iQuestSeqOpFactory> CreateSeqOpFactory ();              \
01825 };
01826 
01830 #define CEL_IMPLEMENT_SEQOPTYPE(name)                                   \
01831 SCF_IMPLEMENT_IBASE (cel##name##SeqOpType)                              \
01832   SCF_IMPLEMENTS_INTERFACE (iQuestSeqOpType)                            \
01833 SCF_IMPLEMENT_IBASE_END                                                 \
01834 cel##name##SeqOpType::cel##name##SeqOpType (                            \
01835         iObjectRegistry* object_reg)                                    \
01836 {                                                                       \
01837   SCF_CONSTRUCT_IBASE (0);                                              \
01838   cel##name##SeqOpType::object_reg = object_reg;                        \
01839 }                                                                       \
01840 cel##name##SeqOpType::~cel##name##SeqOpType ()                          \
01841 {                                                                       \
01842   SCF_DESTRUCT_IBASE ();                                                \
01843 }                                                                       \
01844 csPtr<iQuestSeqOpFactory> cel##name##SeqOpType::CreateSeqOpFactory ()   \
01845 {                                                                       \
01846   cel##name##SeqOpFactory* fact = new cel##name##SeqOpFactory (this);   \
01847   return fact;                                                          \
01848 }
01849 
01850 #endif // __CEL_MGR_QUEST__
01851 

Generated for CEL: Crystal Entity Layer by doxygen 1.4.6