// (c) 2005 kp@kp73.com
using System;
namespace KP.Tetris.Tetraminos{
/// <summary>
/// Tetramino shape J.
/// </summary>
internal class J : Tetramino
{
/// <summary>
/// Get the colour.
/// </summary>
public override KP.Tetris.Colour Colour { get { return KP.Tetris.Colour.Blue; } }
/// <summary>
/// Get the maximum angle of rotation.
/// </summary>
internal override Direction MaxRotation { get { return Direction.East; } }
/// <summary>
/// Populate the shape cell maps with the J 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[3, 1] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[3, 2] = new Cell(true, this.Colour);
base.maps[0] = shape;
shape = new TetraminoMap();
shape.Orientation = Direction.West;
shape[2, 3] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[2, 1] = new Cell(true, this.Colour);
shape[3, 3] = new Cell(true, this.Colour);
base.maps[1] = shape;
shape = new TetraminoMap();
shape.Orientation = Direction.North;
shape[1, 2] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[3, 2] = new Cell(true, this.Colour);
shape[1, 3] = new Cell(true, this.Colour);
base.maps[2] = shape;
shape = new TetraminoMap();
shape.Orientation = Direction.West;
shape[1, 1] = new Cell(true, this.Colour);
shape[2, 1] = new Cell(true, this.Colour);
shape[2, 2] = new Cell(true, this.Colour);
shape[2, 3] = new Cell(true, this.Colour);
base.maps[3] = shape;
}
}
}
|