// (c) 2005 kp@kp73.com
using System;
namespace KP.Tetris{
/// <summary>
/// Cell map of a tetramino's shape
/// </summary>
public class TetraminoMap
{
/// <summary>
/// Get the maximum witdh.
/// </summary>
public static int MaxWidth { get { return 4; } }
/// <summary>
/// Get the maximum height.
/// </summary>
public static int MaxHeight { get { return 4; } }
/// <summary>
/// Cell map contains the shape definition.
/// </summary>
private Cell[, ] shape = new Cell[MaxWidth, MaxHeight];
/// <summary>
/// Orientation of the shape.
/// </summary>
private Direction m_orientation = Direction.North;
/// <summary>
/// Get or set the orientation of the shape.
/// </summary>
internal Direction Orientation
{
get { return m_orientation; }
set { m_orientation = value; }
}
/// <summary>
/// Get or set an element of the shape map.
/// </summary>
public Cell this[int x, int y]
{
get { return shape[x, y]; }
set { shape[x, y] = value; }
}
/// <summary>
/// Get the centre for the tetramino shape.
/// </summary>
internal static Coordinate PointOfOrigin { get { return m_pointOfOrigin; } }
/// <summary>
/// Centre of the tetramino shape.
/// </summary>
private static Coordinate m_pointOfOrigin = new Coordinate(2, 2);
}
}
|