CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ivaria/sequence.h

00001 /*
00002     Copyright (C) 2001 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_IVARIA_SEQUENCE_H__
00020 #define __CS_IVARIA_SEQUENCE_H__
00021 
00022 #include "csutil/scf.h"
00023 
00024 struct iSequenceManager;
00025 
00026 SCF_VERSION (iSequenceOperation, 0, 2, 0);
00027 
00032 struct iSequenceOperation : public iBase
00033 {
00042   virtual void Do (csTicks dt, iBase* params) = 0;
00043 
00049   virtual void CleanupSequences () = 0;
00050 };
00051 
00052 SCF_VERSION (iSequenceCondition, 0, 1, 0);
00053 
00058 struct iSequenceCondition : public iBase
00059 {
00068   virtual bool Condition (csTicks dt, iBase* params) = 0;
00069 };
00070 
00071 struct csSequenceOp
00072 {
00073   csSequenceOp* next, * prev;
00074   csTicks time;
00075   csRef<iBase> params;
00076   csRef<iSequenceOperation> operation;
00077 
00078   csSequenceOp () { }
00079   ~csSequenceOp () { }
00080 };
00081 
00082 
00083 SCF_VERSION (iSequence, 0, 0, 2);
00084 
00091 struct iSequence : public iBase
00092 {
00096   virtual csSequenceOp* GetFirstSequence () = 0;
00097 
00102   virtual void AddOperation (csTicks time, iSequenceOperation* operation,
00103         iBase* params = 0) = 0;
00104 
00109   virtual void AddRunSequence (csTicks time, iSequence* sequence,
00110         iBase* params = 0) = 0;
00111 
00117   virtual void AddCondition (csTicks time, iSequenceCondition* condition,
00118         iSequence* trueSequence, iSequence* falseSequence,
00119         iBase* params = 0) = 0;
00120 
00126   virtual void AddLoop (csTicks time, iSequenceCondition* condition,
00127         iSequence* sequence, iBase* params = 0) = 0;
00128 
00132   virtual void Clear () = 0;
00133 
00137   virtual bool IsEmpty () = 0;
00138 };
00139 
00140 SCF_VERSION (iSequenceManager, 0, 1, 0);
00141 
00147 struct iSequenceManager : public iBase
00148 {
00153   virtual void Clear () = 0;
00154 
00159   virtual bool IsEmpty () = 0;
00160 
00169   virtual void Suspend () = 0;
00170 
00176   virtual void Resume () = 0;
00177 
00181   virtual bool IsSuspended () = 0;
00182 
00195   virtual void TimeWarp (csTicks time, bool skip) = 0;
00196 
00207   virtual csTicks GetMainTime () const = 0;
00208 
00213   virtual csTicks GetDeltaTime () const = 0;
00214 
00220   virtual csPtr<iSequence> NewSequence () = 0;
00221 
00234   virtual void RunSequence (csTicks time, iSequence* sequence,
00235         iBase* params = 0) = 0;
00236 };
00237 
00238 #endif // __CS_IVARIA_SEQUENCE_H__
00239 

Generated for Crystal Space by doxygen 1.2.18