public String getGameState()
	{
		StringBuilder sb=new StringBuilder();

		sb.append(mazeIndex+","+totalTime+","+score+","+currentLevelTime+","+levelCount+","
				+pacman.currentNodeIndex+","+pacman.lastMoveMade+","+pacman.numberOfLivesRemaining+","+pacman.hasReceivedExtraLife+",");

		for(Ghost ghost : ghosts.values())
			sb.append(ghost.currentNodeIndex+","+ghost.edibleTime+","+ghost.lairTime+","+ghost.lastMoveMade+",");

		for(int i=0;i<currentMaze.pillIndices.length;i++)
			if(pills.get(i))
				sb.append("1");
			else
				sb.append("0");

		sb.append(",");
		
		for(int i=0;i<currentMaze.powerPillIndices.length;i++)
			if(powerPills.get(i))
				sb.append("1");
			else
				sb.append("0");
		
		sb.append(",");		
		sb.append(timeOfLastGlobalReversal);
		sb.append(",");		
		sb.append(pacmanWasEaten);
		sb.append(",");	
		
		for(GHOST ghost : GHOST.values())
		{
			sb.append(ghostsEaten.get(ghost));
			sb.append(",");
		}
		
		sb.append(pillWasEaten);
		sb.append(",");
		sb.append(powerPillWasEaten);		
		
		return sb.toString();
	}