public class SmokeManager
{
	public MyVector smokes = new MyVector();

	public bool notPaint;

	public SmokeManager()
	{
		notPaint = false;
	}

	public void addSmoke(float x, float y, sbyte Type)
	{
		if (BackgroundNew.lowGraphic && Type != 7)
		{
			return;
		}
		int num = 300;
		if (mGraphics.zoomLevel == 1)
		{
			num = 10;
		}
		if (BackgroundNew.lowGraphic)
		{
			num = 5;
		}
		if (Type == 7)
		{
			num = 300;
		}
		if (smokes.size() >= ((Type == 7 || Type == 13 || Type == 19 || Type == 21) ? num : 30))
		{
			return;
		}
		if (Type == 4)
		{
			if (CRes.random(2) == 0)
			{
				smokes.addElement(new Smoke(x, y, Type));
			}
		}
		else
		{
			smokes.addElement(new Smoke(x, y, Type));
		}
	}

	public void addLazer(int xF, int yF, int xT, int yT, int type)
	{
		smokes.addElement(new Smoke(xF, yF, xT, yT, type));
	}

	public void addBat(int xF, int yF, int xT, int yT)
	{
		smokes.addElement(new Smoke(xF, yF, xT, yT));
	}

	public void addRock(int x, int y, int vx, int vy, sbyte Type)
	{
		int num = 200;
		if (mGraphics.zoomLevel == 1)
		{
			num = 30;
		}
		num = ((!BackgroundNew.lowGraphic) ? 40 : 10);
		if (Type == 10)
		{
			smokes.addElement(new Smoke(x, y, vx, vy, Type));
		}
		else if (Type != 6 && Type != 8 && Type != 9 && Type != 12)
		{
			if (smokes.size() < num)
			{
				smokes.addElement(new Smoke(x, y, vx, vy, Type));
			}
		}
		else if (smokes.size() < num)
		{
			smokes.addElement(new Smoke(x, y, vx, vy, Type));
		}
	}

	public void update()
	{
		for (int i = 0; i < smokes.size(); i++)
		{
			((Smoke)smokes.elementAt(i)).update();
		}
	}

	public void paint(mGraphics g)
	{
		if (!notPaint)
		{
			for (int i = 0; i < smokes.size(); i++)
			{
				((Smoke)smokes.elementAt(i)).paint(g);
			}
		}
	}

	public void removeSmoke(object smoke)
	{
		smokes.removeElement(smoke);
	}
}
