// (c) 2005 kp@kp73.com
using System;
namespace KP.Tetris.Tetraminos{
/// <summary>
/// Tetramino shape Z.
/// </summary>
internal class Z : Tetramino
{
/// <summary>
/// Get the colour.
/// </summary>
public override KP.Tetris.Colour Colour { get { return KP.Tetris.Colour.Green; } }
/// <summary>
/// Get the maximum angle of rotation.
/// </summary>
internal override Direction MaxRotation { get { return Direction.West; } }
/// <summary>
/// Populate the shape cell maps with the Z shape
/// in each possible orientation.
/// </summary>
protected override void SetShapes()
{
base.maps = new TetraminoMap[(int)MaxRotation + 1];
TetraminoMap shape = null;
shape = new TetraminoMap();
shape.Orientation = Direction.North;
shape[1, 2] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[2, 1] = new Cell(true, this.Colour);
shape[3, 1] = new Cell(true, this.Colour);
base.maps[0] = shape;
shape = new TetraminoMap();
shape.Orientation = Direction.West;
shape[2, 1] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[3, 2] = new Cell(true, this.Colour);
shape[3, 3] = new Cell(true, this.Colour);
base.maps[1] = shape;
}
}
}
|