CEL

Public API Reference

tools/questmanager.h

00001 /*
00002     Crystal Space Entity Layer
00003     Copyright (C) 2004-2006 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/weakref.h"
00026 #include "csutil/hash.h"
00027 #include "csgeom/vector3.h"
00028 
00029 struct iDocumentNode;
00030 struct iChangePropertyQuestRewardFactory;
00031 struct iCelDataBuffer;
00032 struct iQuest;
00033 
00034 /*
00035 <quest name="test">
00036     <state name="notstarted">
00037     </state>
00038 
00039     <state name="start">
00040         <trigger type="ininventory">
00041             <fireon entity="$actor_entity" new_entity="computer_part" />
00042             <reward type="newstate" state="state2" />
00043             <reward type="increasestats" statname="HP" value="3" />
00044         </trigger>
00045         <trigger type="objectdestroyed">
00046             <fireon entity="barrel" />
00047             <reward type="newstate" state="finalstate" />
00048             <reward type="increasestats" statname="HP" value="10" />
00049         </trigger>
00050     </state>
00051 
00052     <state name="state2">
00053         <trigger type="clickonentity">
00054             <fireon entity="" />
00055         </trigger>
00056         <trigger type="cel.questtrigger.entersector">
00057             <fireon entity="player" sector="room" />
00058         </trigger>
00059     </state>
00060 
00061     <sequence name="seqTest">
00062         <op type="movemesh" duration="2000" entity="door"
00063                 x="0" y="4" z="0" />
00064         <op type="lightcolor" duration="2000" entity="lightbulb"
00065                 red="1" green="1" blue="1" />
00066         <delay time="2000" />
00067     </sequence>
00068 
00069     <start>notstarted</start>
00070 </quest>
00071 */
00072 
00073 typedef csHash<csStringBase,csStringBase> celQuestParams;
00074 
00075 //-------------------------------------------------------------------------
00076 // Triggers
00077 //-------------------------------------------------------------------------
00078 
00079 struct iQuestTrigger;
00080 
00087 struct iQuestTriggerCallback : public virtual iBase
00088 {
00089   SCF_INTERFACE (iQuestTriggerCallback, 0, 0, 1);
00090 
00092   virtual void TriggerFired (iQuestTrigger* trigger) = 0;
00093 };
00094 
00107 struct iQuestTrigger : public virtual iBase
00108 {
00109   SCF_INTERFACE (iQuestTrigger, 0, 0, 1);
00110 
00115   virtual void RegisterCallback (iQuestTriggerCallback* callback) = 0;
00116 
00120   virtual void ClearCallback () = 0;
00121 
00125   virtual void ActivateTrigger () = 0;
00126 
00130   virtual void DeactivateTrigger () = 0;
00131 
00137   virtual bool Check () = 0;
00138 
00144   virtual bool LoadAndActivateTrigger (iCelDataBuffer* databuf) = 0;
00145 
00149   virtual void SaveTriggerState (iCelDataBuffer* databuf) = 0;
00150 };
00151 
00156 struct iQuestTriggerFactory : public virtual iBase
00157 {
00158   SCF_INTERFACE (iQuestTriggerFactory, 0, 0, 1);
00159 
00166   virtual csPtr<iQuestTrigger> CreateTrigger (iQuest* quest,
00167         const celQuestParams& params) = 0;
00168 
00174   virtual bool Load (iDocumentNode* node) = 0;
00175 };
00176 
00184 struct iQuestTriggerType : public virtual iBase
00185 {
00186   SCF_INTERFACE (iQuestTriggerType, 0, 0, 1);
00187 
00191   virtual const char* GetName () const = 0;
00192   
00196   virtual csPtr<iQuestTriggerFactory> CreateTriggerFactory () = 0;
00197 };
00198 
00199 //-------------------------------------------------------------------------
00200 // Rewards
00201 //-------------------------------------------------------------------------
00202 
00210 struct iQuestReward : public virtual iBase
00211 {
00212   SCF_INTERFACE (iQuestReward, 0, 0, 1);
00216   virtual void Reward () = 0;
00217 };
00218 
00223 struct iQuestRewardFactory : public virtual iBase
00224 {
00225   SCF_INTERFACE (iQuestRewardFactory, 0, 0, 1);
00226 
00233   virtual csPtr<iQuestReward> CreateReward (iQuest* quest,
00234         const celQuestParams& params) = 0;
00235 
00241   virtual bool Load (iDocumentNode* node) = 0;
00242 };
00243 
00251 struct iQuestRewardType : public virtual iBase
00252 {
00253   SCF_INTERFACE (iQuestRewardType, 0, 0, 1);
00254 
00258   virtual const char* GetName () const = 0;
00259   
00263   virtual csPtr<iQuestRewardFactory> CreateRewardFactory () = 0;
00264 };
00265 
00266 //-------------------------------------------------------------------------
00267 // Sequence operations
00268 //-------------------------------------------------------------------------
00269 
00276 struct iQuestSeqOp : public virtual iBase
00277 {
00278   SCF_INTERFACE (iQuestSeqOp, 0, 0, 1);
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 
00310 struct iQuestSeqOpFactory : public virtual iBase
00311 {
00312   SCF_INTERFACE (iQuestSeqOpFactory, 0, 0, 1);
00313 
00319   virtual csPtr<iQuestSeqOp> CreateSeqOp (const celQuestParams& params) = 0;
00320 
00326   virtual bool Load (iDocumentNode* node) = 0;
00327 };
00328 
00336 struct iQuestSeqOpType : public virtual iBase
00337 {
00338   SCF_INTERFACE (iQuestSeqOpType, 0, 0, 1);
00339 
00343   virtual const char* GetName () const = 0;
00344   
00348   virtual csPtr<iQuestSeqOpFactory> CreateSeqOpFactory () = 0;
00349 };
00350 
00351 struct iQuestSequence;
00352 
00357 struct iQuestSequenceCallback : public virtual iBase
00358 {
00359   SCF_INTERFACE (iQuestSequenceCallback, 0, 0, 1);
00360 
00362   virtual void SequenceFinished (iQuestSequence* sequence) = 0;
00363 };
00364 
00368 struct iQuestSequence : public virtual iBase
00369 {
00370   SCF_INTERFACE (iQuestSequence, 0, 0, 1);
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 
00422 struct iQuest : public virtual iBase
00423 {
00424   SCF_INTERFACE (iQuest, 0, 0, 1);
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 
00461 struct iQuestTriggerResponseFactory : public virtual iBase
00462 {
00463   SCF_INTERFACE (iQuestTriggerResponseFactory, 0, 0, 1);
00464 
00469   virtual void SetTriggerFactory (iQuestTriggerFactory* trigger_fact) = 0;
00470 
00475   virtual void AddRewardFactory (iQuestRewardFactory* reward_fact) = 0;
00476 };
00477 
00482 struct iQuestStateFactory : public virtual iBase
00483 {
00484   SCF_INTERFACE (iQuestStateFactory, 0, 0, 1);
00485 
00489   virtual const char* GetName () const = 0;
00490 
00494   virtual iQuestTriggerResponseFactory* CreateTriggerResponseFactory () = 0;
00495 };
00496 
00501 struct iQuestSequenceFactory : public virtual iBase
00502 {
00503   SCF_INTERFACE (iQuestSequenceFactory, 0, 0, 1);
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 
00548 struct iQuestFactory : public virtual iBase
00549 {
00550   SCF_INTERFACE (iQuestFactory, 0, 0, 1);
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 
00625 struct iQuestManager : public virtual iBase
00626 {
00627   SCF_INTERFACE (iQuestManager, 0, 0, 1);
00628 
00656   virtual bool RegisterTriggerType (iQuestTriggerType* trigger) = 0;
00657 
00662   virtual iQuestTriggerType* GetTriggerType (const char* name) = 0;
00663 
00691   virtual bool RegisterRewardType (iQuestRewardType* trigger) = 0;
00692 
00697   virtual iQuestRewardType* GetRewardType (const char* name) = 0;
00698 
00716   virtual bool RegisterSeqOpType (iQuestSeqOpType* seqop) = 0;
00717 
00722   virtual iQuestSeqOpType* GetSeqOpType (const char* name) = 0;
00723 
00727   virtual iQuestFactory* GetQuestFactory (const char* name) = 0;
00728 
00734   virtual iQuestFactory* CreateQuestFactory (const char* name) = 0;
00735 
00743   virtual const char* ResolveParameter (
00744         const celQuestParams& params,
00745         const char* param) = 0;
00746 
00752   virtual bool Load (iDocumentNode* node) = 0;
00753 
00758   virtual iQuestRewardFactory* AddNewStateReward (
00759         iQuestTriggerResponseFactory* response,
00760         const char* entity_par, const char* state_par) = 0;
00761 
00766   virtual iQuestRewardFactory* AddDebugPrintReward (
00767         iQuestTriggerResponseFactory* response,
00768         const char* msg_par) = 0;
00769 
00774   virtual iQuestRewardFactory* AddInventoryReward (
00775         iQuestTriggerResponseFactory* response,
00776         const char* entity_par, const char* child_entity_par) = 0;
00777 
00782   virtual iQuestRewardFactory* AddSequenceReward (
00783         iQuestTriggerResponseFactory* response,
00784         const char* entity_par, const char* sequence_par,
00785         const char* delay_par) = 0;
00786 
00791   virtual iQuestRewardFactory* AddCsSequenceReward (
00792         iQuestTriggerResponseFactory* response,
00793         const char* sequence_par, const char* delay_par) = 0;
00794 
00799   virtual iQuestRewardFactory* AddSequenceFinishReward (
00800         iQuestTriggerResponseFactory* response,
00801         const char* entity_par, const char* sequence_par) = 0;
00802 
00808   virtual iChangePropertyQuestRewardFactory* AddChangePropertyReward (
00809         iQuestTriggerResponseFactory* response,
00810         const char* entity_par, const char* prop_par) = 0;
00811 
00816   virtual iQuestTriggerFactory* SetTimeoutTrigger (
00817         iQuestTriggerResponseFactory* response,
00818         const char* timeout_par) = 0;
00819 
00824   virtual iQuestTriggerFactory* SetEnterSectorTrigger (
00825         iQuestTriggerResponseFactory* response,
00826         const char* entity_par, const char* sector_par) = 0;
00827 
00832   virtual iQuestTriggerFactory* SetMeshEnterSectorTrigger (
00833         iQuestTriggerResponseFactory* response,
00834         const char* entity_par, const char* sector_par) = 0;
00835 
00840   virtual iQuestTriggerFactory* SetSequenceFinishTrigger (
00841         iQuestTriggerResponseFactory* response,
00842         const char* entity_par, const char* sequence_par) = 0;
00843 
00848   virtual iQuestTriggerFactory* SetPropertyChangeTrigger (
00849         iQuestTriggerResponseFactory* response,
00850         const char* entity_par, const char* prop_par,
00851         const char* value_par) = 0;
00852 
00857   virtual iQuestTriggerFactory* SetTriggerTrigger (
00858         iQuestTriggerResponseFactory* response,
00859         const char* entity_par, bool do_leave = false) = 0;
00860 
00865   virtual iQuestTriggerFactory* SetWatchTrigger (
00866         iQuestTriggerResponseFactory* response,
00867         const char* entity_par, const char* target_entity_par,
00868         const char* checktime_par,
00869         const char* radius_par) = 0;
00870 };
00871 
00872 //-------------------------------------------------------------------------
00873 // Specific trigger implementations.
00874 //-------------------------------------------------------------------------
00875 
00888 struct iTimeoutQuestTriggerFactory : public virtual iBase
00889 {
00890   SCF_INTERFACE (iTimeoutQuestTriggerFactory, 0, 0, 1);
00891 
00897   virtual void SetTimeoutParameter (const char* timeout_par) = 0;
00898 };
00899 
00920 struct iPropertyChangeQuestTriggerFactory : public virtual iBase
00921 {
00922   SCF_INTERFACE (iPropertyChangeQuestTriggerFactory, 0, 0, 1);
00923 
00932   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
00933 
00939   virtual void SetPropertyParameter (const char* prop) = 0;
00940 
00947   virtual void SetValueParameter (const char* value) = 0;
00948 };
00949 
00966 struct iMeshSelectQuestTriggerFactory : public virtual iBase
00967 {
00968   SCF_INTERFACE (iMeshSelectQuestTriggerFactory, 0, 0, 1);
00969 
00978   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
00979 };
00980 
01000 struct iInventoryQuestTriggerFactory : public virtual iBase
01001 {
01002   SCF_INTERFACE (iInventoryQuestTriggerFactory, 0, 0, 1);
01003 
01012   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01013 
01021   virtual void SetChildEntityParameter (const char* child_entity) = 0;
01022 };
01023 
01044 struct iEnterSectorQuestTriggerFactory : public virtual iBase
01045 {
01046   SCF_INTERFACE (iEnterSectorQuestTriggerFactory, 0, 0, 1);
01047 
01056   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01057 
01064   virtual void SetSectorParameter (const char* sector) = 0;
01065 };
01066 
01084 struct iSequenceFinishQuestTriggerFactory : public virtual iBase
01085 {
01086   SCF_INTERFACE (iSequenceFinishQuestTriggerFactory, 0, 0, 1);
01087 
01096   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01097 
01103   virtual void SetSequenceParameter (const char* sequence) = 0;
01104 };
01105 
01123 struct iTriggerQuestTriggerFactory : public virtual iBase
01124 {
01125   SCF_INTERFACE (iTriggerQuestTriggerFactory, 0, 0, 1);
01126 
01135   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01136 
01141   virtual void EnableLeave () = 0;
01142 };
01143 
01169 struct iWatchQuestTriggerFactory : public virtual iBase
01170 {
01171   SCF_INTERFACE (iWatchQuestTriggerFactory, 0, 0, 1);
01172 
01181   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01182 
01191   virtual void SetTargetEntityParameter (const char* entity,
01192       const char* tag = 0) = 0;
01193 
01201   virtual void SetChecktimeParameter (const char* time) = 0;
01202 
01209   virtual void SetRadiusParameter (const char* radius) = 0;
01210 
01218   virtual void SetOffsetParameter (const char* offsetx,
01219       const char* offsety, const char* offsetz) = 0;
01220 };
01221 
01222 //-------------------------------------------------------------------------
01223 // Specific reward implementations.
01224 //-------------------------------------------------------------------------
01225 
01238 struct iDebugPrintQuestRewardFactory : public virtual iBase
01239 {
01240   SCF_INTERFACE (iDebugPrintQuestRewardFactory, 0, 0, 1);
01241 
01246   virtual void SetMessageParameter (const char* msg) = 0;
01247 };
01248 
01265 struct iNewStateQuestRewardFactory : public virtual iBase
01266 {
01267   SCF_INTERFACE (iNewStateQuestRewardFactory, 0, 0, 1);
01268 
01275   virtual void SetStateParameter (const char* state) = 0;
01276 
01285   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01286 };
01287 
01312 struct iChangePropertyQuestRewardFactory : public virtual iBase
01313 {
01314   SCF_INTERFACE (iChangePropertyQuestRewardFactory, 0, 0, 1);
01315 
01322   virtual void SetEntityParameter (const char* entity) = 0;
01323 
01333   virtual void SetPCParameter (const char* pc, const char* tag) = 0;
01334 
01340   virtual void SetPropertyParameter (const char* prop) = 0;
01341 
01346   virtual void SetStringParameter (const char* pstring) = 0;
01347 
01352   virtual void SetLongParameter (const char* plong) = 0;
01353 
01358   virtual void SetFloatParameter (const char* pfloat) = 0;
01359 
01364   virtual void SetBoolParameter (const char* pbool) = 0;
01365 
01370   virtual void SetDiffParameter (const char* pdiff) = 0;
01371 
01375   virtual void SetToggle () = 0;
01376 };
01377 
01397 struct iInventoryQuestRewardFactory : public virtual iBase
01398 {
01399   SCF_INTERFACE (iInventoryQuestRewardFactory, 0, 0, 1);
01400 
01409   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01410 
01416   virtual void SetChildEntityParameter (const char* entity,
01417         const char* tag = 0) = 0;
01418 };
01419 
01433 struct iCsSequenceQuestRewardFactory : public virtual iBase
01434 {
01435   SCF_INTERFACE (iCsSequenceQuestRewardFactory, 0, 0, 1);
01436 
01442   virtual void SetSequenceParameter (const char* sequence) = 0;
01443 
01448   virtual void SetDelayParameter (const char* delay) = 0;
01449 };
01450 
01467 struct iSequenceQuestRewardFactory : public virtual iBase
01468 {
01469   SCF_INTERFACE (iSequenceQuestRewardFactory, 0, 0, 1);
01470 
01479   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01480 
01486   virtual void SetSequenceParameter (const char* sequence) = 0;
01487 
01492   virtual void SetDelayParameter (const char* delay) = 0;
01493 };
01494 
01510 struct iSequenceFinishQuestRewardFactory : public virtual iBase
01511 {
01512   SCF_INTERFACE (iSequenceFinishQuestRewardFactory, 0, 0, 1);
01513 
01522   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01523 
01529   virtual void SetSequenceParameter (const char* sequence) = 0;
01530 };
01531 
01545 struct iMessageQuestRewardFactory : public virtual iBase
01546 {
01547   SCF_INTERFACE (iMessageQuestRewardFactory, 0, 0, 1);
01548 
01554   virtual void SetEntityParameter (const char* entity) = 0;
01555 
01560   virtual void SetIDParameter (const char* id) = 0;
01561 
01571   virtual void AddParameter (celDataType type, csStringID id,
01572       const char* name, const char* value) = 0;
01573 };
01574 
01590 struct iActionQuestRewardFactory : public virtual iBase
01591 {
01592   SCF_INTERFACE (iActionQuestRewardFactory, 0, 0, 1);
01593 
01599   virtual void SetEntityParameter (const char* entity) = 0;
01600 
01605   virtual void SetIDParameter (const char* id) = 0;
01606 
01612   virtual void SetPropertyClassParameter (const char* propertyclass) = 0;
01613 
01619   virtual void SetTagParameter (const char* tag) = 0;
01620 
01630   virtual void AddParameter (celDataType type, csStringID id,
01631       const char* name, const char* value) = 0;
01632 };
01633 
01645 struct iDestroyEntityQuestRewardFactory : public virtual iBase
01646 {
01647   SCF_INTERFACE (iDestroyEntityQuestRewardFactory, 0, 0, 1);
01648 
01654   virtual void SetEntityParameter (const char* entity) = 0;
01655 };
01656 
01657 
01658 //-------------------------------------------------------------------------
01659 // Specific sequence operation implementations.
01660 //-------------------------------------------------------------------------
01661 
01674 struct iDebugPrintQuestSeqOpFactory : public virtual iBase
01675 {
01676   SCF_INTERFACE (iDebugPrintQuestSeqOpFactory, 0, 0, 1);
01677 
01682   virtual void SetMessageParameter (const char* msg) = 0;
01683 };
01684 
01708 struct iTransformQuestSeqOpFactory : public virtual iBase
01709 {
01710   SCF_INTERFACE (iTransformQuestSeqOpFactory, 0, 0, 1);
01711 
01718   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01719 
01723   virtual void SetVectorParameter (const char* vectorx, const char* vectory,
01724         const char* vectorz) = 0;
01725 
01731   virtual void SetRotationParameter (int rot_axis, const char* rot_angle) = 0;
01732 };
01733 
01753 struct iMovePathQuestSeqOpFactory : public virtual iBase
01754 {
01755   SCF_INTERFACE (iMovePathQuestSeqOpFactory, 0, 0, 1);
01756 
01763   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01764 
01774   virtual void AddPathNode (const char* sectorname, const char* node,
01775         const char* time) = 0;
01776 };
01777 
01798 struct iLightQuestSeqOpFactory : public virtual iBase
01799 {
01800   SCF_INTERFACE (iLightQuestSeqOpFactory, 0, 0, 1);
01801 
01808   virtual void SetEntityParameter (const char* entity, const char* tag = 0) = 0;
01809 
01813   virtual void SetRelColorParameter (const char* red, const char* green,
01814         const char* blue) = 0;
01815 
01819   virtual void SetAbsColorParameter (const char* red, const char* green,
01820         const char* blue) = 0;
01821 };
01822 
01823 //-------------------------------------------------------------------------
01824 
01828 #define CEL_DECLARE_REWARDTYPE(name,id)                                 \
01829 class cel##name##RewardType : public scfImplementation1<                \
01830                 cel##name##RewardType,iQuestRewardType>                 \
01831 {                                                                       \
01832 public:                                                                 \
01833   iObjectRegistry* object_reg;                                          \
01834   csWeakRef<iCelPlLayer> pl;                                            \
01835   cel##name##RewardType (iObjectRegistry* object_reg);                  \
01836   virtual ~cel##name##RewardType () { }                                 \
01837   virtual const char* GetName () const { return id; }                   \
01838   virtual csPtr<iQuestRewardFactory> CreateRewardFactory ();            \
01839 };
01840 
01844 #define CEL_IMPLEMENT_REWARDTYPE(name)                                  \
01845 cel##name##RewardType::cel##name##RewardType (                          \
01846         iObjectRegistry* object_reg) : scfImplementationType (this)     \
01847 {                                                                       \
01848   cel##name##RewardType::object_reg = object_reg;                       \
01849   pl = csQueryRegistry<iCelPlLayer> (object_reg);                       \
01850 }                                                                       \
01851 csPtr<iQuestRewardFactory> cel##name##RewardType::CreateRewardFactory ()\
01852 {                                                                       \
01853   cel##name##RewardFactory* fact = new                                  \
01854         cel##name##RewardFactory (this);                                \
01855   return fact;                                                          \
01856 }
01857 
01861 #define CEL_DECLARE_TRIGGERTYPE(name,id)                                \
01862 class cel##name##TriggerType : public scfImplementation1<               \
01863                 cel##name##TriggerType,iQuestTriggerType>               \
01864 {                                                                       \
01865 public:                                                                 \
01866   iObjectRegistry* object_reg;                                          \
01867   csWeakRef<iCelPlLayer> pl;                                            \
01868   cel##name##TriggerType (iObjectRegistry* object_reg);                 \
01869   virtual ~cel##name##TriggerType () { }                                \
01870   virtual const char* GetName () const { return id; }                   \
01871   virtual csPtr<iQuestTriggerFactory> CreateTriggerFactory ();          \
01872 };
01873 
01877 #define CEL_IMPLEMENT_TRIGGERTYPE(name)                                 \
01878 cel##name##TriggerType::cel##name##TriggerType (                        \
01879         iObjectRegistry* object_reg) : scfImplementationType (this)     \
01880 {                                                                       \
01881   cel##name##TriggerType::object_reg = object_reg;                      \
01882   pl = csQueryRegistry<iCelPlLayer> (object_reg);                       \
01883 }                                                                       \
01884 csPtr<iQuestTriggerFactory> cel##name##TriggerType::CreateTriggerFactory () \
01885 {                                                                       \
01886   cel##name##TriggerFactory* fact = new cel##name##TriggerFactory (this); \
01887   return fact;                                                          \
01888 }
01889 
01893 #define CEL_DECLARE_SEQOPTYPE(name,id)                                  \
01894 class cel##name##SeqOpType : public scfImplementation1<                 \
01895         cel##name##SeqOpType,iQuestSeqOpType>                           \
01896 {                                                                       \
01897 public:                                                                 \
01898   iObjectRegistry* object_reg;                                          \
01899   csWeakRef<iCelPlLayer> pl;                                            \
01900   cel##name##SeqOpType (iObjectRegistry* object_reg);                   \
01901   virtual ~cel##name##SeqOpType () { }                                  \
01902   virtual const char* GetName () const { return id; }                   \
01903   virtual csPtr<iQuestSeqOpFactory> CreateSeqOpFactory ();              \
01904 };
01905 
01909 #define CEL_IMPLEMENT_SEQOPTYPE(name)                                   \
01910 cel##name##SeqOpType::cel##name##SeqOpType (                            \
01911         iObjectRegistry* object_reg) : scfImplementationType (this)     \
01912 {                                                                       \
01913   cel##name##SeqOpType::object_reg = object_reg;                        \
01914   pl = csQueryRegistry<iCelPlLayer> (object_reg);                       \
01915 }                                                                       \
01916 csPtr<iQuestSeqOpFactory> cel##name##SeqOpType::CreateSeqOpFactory ()   \
01917 {                                                                       \
01918   cel##name##SeqOpFactory* fact = new cel##name##SeqOpFactory (this);   \
01919   return fact;                                                          \
01920 }
01921 
01922 #endif // __CEL_MGR_QUEST__
01923 

Generated for CEL: Crystal Entity Layer by doxygen 1.4.7