53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
|
|
using MainShell.Models;
|
||
|
|
using System;
|
||
|
|
|
||
|
|
namespace MainShell.Process
|
||
|
|
{
|
||
|
|
public class DieTransferRegion
|
||
|
|
{
|
||
|
|
public int StartRow { get; set; }
|
||
|
|
|
||
|
|
public int StartCol { get; set; }
|
||
|
|
|
||
|
|
public int EndRow { get; set; }
|
||
|
|
|
||
|
|
public int EndCol { get; set; }
|
||
|
|
|
||
|
|
public int RowCount
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
return EndRow - StartRow + 1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public int ColCount
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
return EndCol - StartCol + 1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public bool Contains(int row, int column)
|
||
|
|
{
|
||
|
|
return row >= StartRow && row <= EndRow && column >= StartCol && column <= EndCol;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static DieTransferRegion FromRegionModel(RegionModel regionModel)
|
||
|
|
{
|
||
|
|
if (regionModel == null)
|
||
|
|
{
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
DieTransferRegion region = new DieTransferRegion();
|
||
|
|
region.StartRow = regionModel.StartRow;
|
||
|
|
region.StartCol = regionModel.StartCol;
|
||
|
|
region.EndRow = regionModel.EndRow;
|
||
|
|
region.EndCol = regionModel.EndCol;
|
||
|
|
return region;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|