ConstructionYard.cs!
git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1286 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
38
OpenRa.Game/ConstructionYard.cs
Normal file
38
OpenRa.Game/ConstructionYard.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using BluntDirectX.Direct3D;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
class ConstructionYard : Actor
|
||||
{
|
||||
static Range<int> normalSequence = UnitSheetBuilder.GetUnit("fact");
|
||||
static Range<int> makeSequence = UnitSheetBuilder.GetUnit("factmake");
|
||||
|
||||
Range<int> sequence = makeSequence;
|
||||
int frame = -1;
|
||||
|
||||
public ConstructionYard(float2 location, int palette)
|
||||
{
|
||||
this.renderLocation = location;
|
||||
this.palette = palette;
|
||||
}
|
||||
|
||||
public override Sprite[] CurrentImages
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((sequence.Start == makeSequence.Start) && ++frame >= sequence.End - sequence.Start)
|
||||
{
|
||||
frame = 0;
|
||||
sequence = normalSequence;
|
||||
}
|
||||
|
||||
return new Sprite[] { UnitSheetBuilder.sprites[sequence.Start + frame] };
|
||||
}
|
||||
}
|
||||
|
||||
public override void Tick(World world, double t) { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user