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_interface.h"
00027 
00039 struct iSequenceOperation : public virtual iBase
00040 {
00041   SCF_INTERFACE (iSequenceOperation, 2, 0, 0);
00050   virtual void Do (csTicks dt, iBase* params) = 0;
00051 
00057   virtual void CleanupSequences () = 0;
00058 };
00059 
00071 struct iSequenceCondition : public virtual iBase
00072 {
00073   SCF_INTERFACE (iSequenceCondition, 1, 0, 0);
00074 
00083   virtual bool Condition (csTicks dt, iBase* params) = 0;
00084 };
00085 
00086 struct csSequenceOp
00087 {
00088   csSequenceOp* next, * prev;
00089   csTicks time;
00090   csRef<iBase> params;
00091   csRef<iSequenceOperation> operation;
00092   // Unique id to identify all operations belonging to a running sequence.
00093   uint sequence_id;
00094 
00095   csSequenceOp () { }
00096   ~csSequenceOp () { }
00097 };
00098 
00099 
00113 struct iSequence : public virtual iBase
00114 {
00115   SCF_INTERFACE (iSequence, 1, 0, 0);
00116 
00120   virtual csSequenceOp* GetFirstSequence () = 0;
00121 
00126   virtual void AddOperation (csTicks time, iSequenceOperation* operation,
00127         iBase* params = 0, uint sequence_id = 0) = 0;
00128 
00133   virtual void AddRunSequence (csTicks time, iSequence* sequence,
00134         iBase* params = 0, uint sequence_id = 0) = 0;
00135 
00141   virtual void AddCondition (csTicks time, iSequenceCondition* condition,
00142         iSequence* trueSequence, iSequence* falseSequence,
00143         iBase* params = 0, uint sequence_id = 0) = 0;
00144 
00150   virtual void AddLoop (csTicks time, iSequenceCondition* condition,
00151         iSequence* sequence, iBase* params = 0, uint sequence_id = 0) = 0;
00152 
00156   virtual void Clear () = 0;
00157 
00161   virtual bool IsEmpty () = 0;
00162 };
00163 
00179 struct iSequenceManager : public virtual iBase
00180 {
00181   SCF_INTERFACE (iSequenceManager, 1, 0, 0);
00182 
00187   virtual void Clear () = 0;
00188 
00193   virtual bool IsEmpty () = 0;
00194 
00203   virtual void Suspend () = 0;
00204 
00210   virtual void Resume () = 0;
00211 
00215   virtual bool IsSuspended () = 0;
00216 
00229   virtual void TimeWarp (csTicks time, bool skip) = 0;
00230 
00241   virtual csTicks GetMainTime () const = 0;
00242 
00247   virtual csTicks GetDeltaTime () const = 0;
00248 
00254   virtual csPtr<iSequence> NewSequence () = 0;
00255 
00276   virtual void RunSequence (csTicks time, iSequence* sequence,
00277         iBase* params = 0, uint sequence_id = 0) = 0;
00278 
00282   virtual void DestroySequenceOperations (uint sequence_id) = 0;
00283 
00288   virtual uint GetUniqueID () = 0;
00289 };
00290 
00291 #endif // __CS_IVARIA_SEQUENCE_H__
00292 

Generated for Crystal Space by doxygen 1.4.7