/// <summary>Construct an instance.</summary> /// <param name="LeftSprite">Left animated sprite for this piece.</param> /// <param name="RightSprite">Right animated sprite for this piece.</param> /// <param name="UpSprite">Up animated sprite for this piece.</param> /// <param name="DownSprite">Down animated sprite for this piece.</param> /// <param name="startingSpriteDirection">The sprite's initial facing direction.</param> public AnimatedSpriteCollection(AnimatedSpriteExtended LeftSprite, AnimatedSpriteExtended RightSprite, AnimatedSpriteExtended UpSprite, AnimatedSpriteExtended DownSprite, Direction startingSpriteDirection) { this.leftSprite = LeftSprite; this.rightSprite = RightSprite; this.upSprite = UpSprite; this.downSprite = DownSprite; switch (startingSpriteDirection) { case Direction.down: this.setDown(); break; case Direction.left: this.setLeft(); break; case Direction.right: this.setRight(); break; case Direction.up: this.setUp(); break; } }
/// <summary>Sets the current sprite direction to face up.</summary> public void setUp() { this.currentSprite = this.upSprite; }
/// <summary>Sets the current sprite direction to face down.</summary> public void setDown() { this.currentSprite = this.downSprite; }
/// <summary>Sets the current sprite direction to face right.</summary> public void setRight() { this.currentSprite = this.rightSprite; }
/// <summary>Sets the current sprite direction to face left.</summary> public void setLeft() { this.currentSprite = this.leftSprite; }