/// The <see cref="Drive"/> interface, which contains a grid of indices of items in the <see cref="Drive"/>. Use <see cref="GetItemAt(int, int)"/> to get items in the interface.
/// </summary>
publicclassDriveInterface{
/// <summary>
/// Width of the interface.
/// </summary>
publicconstintWidth=8;
/// <summary>
/// Minimun height of the interface.
/// </summary>
publicconstintMinHeight=4;
privateint[,]ItemGrid=newint[4,Width];
privateDriveDrive;
/// <summary>
/// Creates a Drive interface for a <see cref="Drive"/>.
/// </summary>
/// <param name="drive"></param>
publicDriveInterface(Drivedrive){
Drive=drive;
}
/// <summary>
/// Returns the item at the specified coordinate on the interface. Returns null if invalid or empty coordinate.
/// </summary>
/// <param name="x">The x-coordinate</param>
/// <param name="y">The y-coordinate</param>
/// <returns>The item or null</returns>
publicItemGetItemAt(intx,inty){
if(ItemGrid[y,x]==0){
returnnull;
}else{
returnDrive.GetItem(ItemGrid[y,x]);
}
}
/// <summary>
/// Gets the Width of the interface, or simply <see cref="Width"/>.