git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1293 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-17 12:07:08 +00:00
parent 742a91c3f2
commit 75d6c359f1
2 changed files with 54 additions and 0 deletions

53
OpenRa.Game/Animation.cs Normal file
View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace OpenRa.Game
{
class Animation
{
readonly string name;
Sequence currentSequence;
int frame = 0;
public Animation( string name )
{
this.name = name;
PlayToEnd( "idle" );
}
public Sprite[] Images { get { return new Sprite[] { currentSequence.GetSprite( frame ) }; } }
public void PlayToEnd( string sequenceName )
{
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
frame = 0;
//tickFunc = delegate
//{
// ++frame;
// if( frame >= currentSequence.Length )
// {
// frame = currentSequence.Length - 1;
// tickFunc = delegate { };
// }
//};
}
public void PlayRepeating( string sequenceName )
{
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
frame = 0;
//tickFunc = delegate
//{
// frame = ( frame + 1 ) % currentSequence.Length;
//};
}
Action<double> tickFunc;
public void Tick( double t )
{
//tickFunc( t );
}
}
}