예제 #1
0
        private void SelectHexMessageFunction(SelectHexMessage msg)
        {
            HexModel nextSelectedHexModel     = GetHexModel(msg.Column, msg.Row);
            HexModel previousSelectedHexModel = ListHexModel.FirstOrDefault(x => x.Selected);

            if (previousSelectedHexModel != null)
            {
                previousSelectedHexModel.UnselectHex();
                if (previousSelectedHexModel != nextSelectedHexModel)
                {
                    nextSelectedHexModel.SelectHex();
                }
            }
            else
            {
                nextSelectedHexModel.SelectHex();
            }
        }
예제 #2
0
 public HexModel GetHexModel(int column, int row)
 {
     return(ListHexModel.FirstOrDefault(x => x.Column == column && x.Row == row));
 }