@Override
	public void parseFlatString(final String flat)
	{
		final String[] parts=flat.split(",");
		if(parts.length < 12 )
			throw new IllegalArgumentException("Wrong number of commas in argument: "+flat);
		targetMajorMask = CMath.s_int(parts[0]);
		sourceMajorMask = CMath.s_int(parts[1]);
		othersMajorMask = CMath.s_int(parts[2]);
		targetMinorType = CMath.s_int(parts[3]);
		sourceMinorType = CMath.s_int(parts[4]);
		othersMinorType = CMath.s_int(parts[5]);
		CMObject o;
		o = parseFlatObject(parts[6], CMClass.CMObjectType.MOB);
		if(o instanceof MOB)
			myAgent = (MOB)o;
		else
			throw new IllegalArgumentException("Agent is not a MOB: "+parts[6]);
		o = parseFlatObject(parts[7], CMClass.CMObjectType.MOB);
		if((o==null) || (o instanceof Environmental))
			myTarget = (Environmental)o;
		else
			throw new IllegalArgumentException("Target is not an Environmental: "+parts[7]);
		o = parseFlatObject(parts[8], CMClass.CMObjectType.ABILITY);
		if((o==null) || (o instanceof Environmental))
			myTool = (Environmental)o;
		else
			throw new IllegalArgumentException("Tool is not an Environmental: "+parts[8]);
		sourceMsg=parts[9].equals("&null;") ? null : CMStrings.replaceAll(parts[9],"&comma;",",");
		targetMsg=parts[10].equals("&null;") ? null : CMStrings.replaceAll(parts[10],"&comma;",",");
		othersMsg=parts[11].equals("&null;") ? null : CMStrings.replaceAll(parts[11],"&comma;",",");
	}