Skip to content
Snippets Groups Projects
Commit 0137b0b5 authored by Floris's avatar Floris
Browse files

tileinput restriction

parent 207cd0af
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
......@@ -78,6 +79,8 @@ namespace PuzzlePlayer_Namespace
public override void TileInput(Point? p, Keys k)
{
if (p == null) return;
double center = ((double)boardState.GetLength(0) - 1) / 2;
if (Math.Abs(((Point)p).X - center) == center && Math.Abs(((Point)p).Y - center) == center) return;
int num = (int)k - 48;
if (num > 0 && num <= boardState.GetLength(0)) boardState[((Point)p).X, ((Point)p).Y] = num;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment