public void processGroups()
	{

		groups = new ArrayList<GroupAi>();
		for (Square[] c : squares)
		{
			for (Square s : c)
			{
				if (s.piece != null)
				{
					boolean inGroup = false;
					for (GroupAi g : groups)
					{
						if (g.pieces.contains(s.piece))
						{
							inGroup = true;
							break;
						}
					}
					if (!inGroup)
					{
						GroupAi g = new GroupAi(this);
						groups.add(g);
						addToGroup(g, s.piece);
					}
				}
			}
		}
	}