CrystalSpace

Public API Reference

ivaria/sequence.h

Go to the documentation of this file.
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 
00026 #include "csutil/scf.h"
00027 
00028 struct iSequenceManager;
00029 
00030 SCF_VERSION (iSequenceOperation, 0, 2, 0);
00031 
00043 struct iSequenceOperation : public iBase
00044 {
00053   virtual void Do (csTicks dt, iBase* params) = 0;
00054 
00060   virtual void CleanupSequences () = 0;
00061 };
00062 
00063 SCF_VERSION (iSequenceCondition, 0, 1, 0);
00064 
00076 struct iSequenceCondition : public iBase
00077 {
00086   virtual bool Condition (csTicks dt, iBase* params) = 0;
00087 };
00088 
00089 struct csSequenceOp
00090 {
00091   csSequenceOp* next, * prev;
00092   csTicks time;
00093   csRef<iBase> params;
00094   csRef<iSequenceOperation> operation;
00095   // Unique id to identify all operations belonging to a running sequence.
00096   uint sequence_id;
00097 
00098   csSequenceOp () { }
00099   ~csSequenceOp () { }
00100 };
00101 
00102 
00103 SCF_VERSION (iSequence, 0, 0, 2);
00104 
00118 struct iSequence : public iBase
00119 {
00123   virtual csSequenceOp* GetFirstSequence () = 0;
00124 
00129   virtual void AddOperation (csTicks time, iSequenceOperation* operation,
00130         iBase* params = 0, uint sequence_id = 0) = 0;
00131 
00136   virtual void AddRunSequence (csTicks time, iSequence* sequence,
00137         iBase* params = 0, uint sequence_id = 0) = 0;
00138 
00144   virtual void AddCondition (csTicks time, iSequenceCondition* condition,
00145         iSequence* trueSequence, iSequence* falseSequence,
00146         iBase* params = 0, uint sequence_id = 0) = 0;
00147 
00153   virtual void AddLoop (csTicks time, iSequenceCondition* condition,
00154         iSequence* sequence, iBase* params = 0, uint sequence_id = 0) = 0;
00155 
00159   virtual void Clear () = 0;
00160 
00164   virtual bool IsEmpty () = 0;
00165 };
00166 
00167 SCF_VERSION (iSequenceManager, 0, 1, 0);
00168 
00184 struct iSequenceManager : public iBase
00185 {
00190   virtual void Clear () = 0;
00191 
00196   virtual bool IsEmpty () = 0;
00197 
00206   virtual void Suspend () = 0;
00207 
00213   virtual void Resume () = 0;
00214 
00218   virtual bool IsSuspended () = 0;
00219 
00232   virtual void TimeWarp (csTicks time, bool skip) = 0;
00233 
00244   virtual csTicks GetMainTime () const = 0;
00245 
00250   virtual csTicks GetDeltaTime () const = 0;
00251 
00257   virtual csPtr<iSequence> NewSequence () = 0;
00258 
00279   virtual void RunSequence (csTicks time, iSequence* sequence,
00280         iBase* params = 0, uint sequence_id = 0) = 0;
00281 
00285   virtual void DestroySequenceOperations (uint sequence_id) = 0;
00286 
00291   virtual uint GetUniqueID () = 0;
00292 };
00293 
00294 #endif // __CS_IVARIA_SEQUENCE_H__
00295 

Generated for Crystal Space by doxygen 1.4.6