<commit_before>using Microsoft.Xna.Framework;
using RenderBuddy;

namespace DrawListBuddy
{
	/// <summary>
	/// objects used to sort images in a draw list before they are actually rendered
	/// </summary>
	public class Quad
	{
		#region Properties

		public ITexture Image { get; private set; }

		public Vector2 Position { get; private set; }

		public float Rotation { get; private set; }

		public bool Flip { get; private set; }

		/// <summary>
		/// Get or set the layer to render at
		/// </summary>
		public int Layer { get; private set; }

		public Color PrimaryColor { get; private set; }

		public Color SecondaryColor { get; private set; }

		/// <summary>
		/// The position of this wuad in the drawlist, quads added later have higher number
		/// If two quads have the same layer, the QuadSort uses this number to sort them out
		/// </summary>
		/// <value>The list position.</value>
		public int ListPosition { get; private set; }

		#endregion //Properties

		#region Methods

		public Quad()
		{
		}

		/// <summary>
		/// hello, standard constructor!
		/// </summary>
		/// <param name="image">the id of teh bitmap for this quad</param>
		/// <param name="position">the position to render the upper left at</param>
		/// <param name="primaryColor">the color to tint this quad</param>
		/// <param name="secondaryColor"></param>
		/// <param name="rotation">the amount to rotate this image</param>
		/// <param name="flip">whether or not this image is flipped</param>
		/// <param name="layer">the layer to render the bitmap at</param>
		/// <param name="listPos"></param>
		public Quad(ITexture image,
			Vector2 position, 
			Color primaryColor,
			Color secondaryColor,
			float rotation, 
			bool flip, 
			int layer,
			int listPos)
		{
			Initialize(image, position, primaryColor, secondaryColor, rotation, flip, layer, listPos);
		}

		/// <summary>
		/// Set all the items of this quad
		/// </summary>
		/// <param name="image">the id of teh bitmap for this quad</param>
		/// <param name="position">the position to render the upper left at</param>
		/// <param name="primaryColor">the color to tint this quad</param>
		/// <param name="secondaryColor"></param>
		/// <param name="rotation">the amount to rotate this image</param>
		/// <param name="flip">whether or not this image is flipped</param>
		/// <param name="layer">the layer to render the bitmap at</param>
		/// <param name="listPos"></param>
		public void Initialize(ITexture image, 
			Vector2 position,
			Color primaryColor,
			Color secondaryColor,
			float rotation,
			bool flip,
			int layer,
			int listPos)
		{
			Image = image;
			Position = position;
			Rotation = rotation;
			Flip = flip;
			Layer = layer;
			PrimaryColor = primaryColor;
			SecondaryColor = secondaryColor;
			ListPosition = listPos;
		}

		/// <summary>
		/// Given a drawlist color and the palette swap color, get the final color to use
		/// </summary>
		/// <returns>The color to drwa the image</returns>
		/// <param name="drawlistColor">Drawlist color.</param>
		/// <param name="combineColor">the color to mix with the drawlist color</param>
		public Color FinalColor(Color drawlistColor, Color combineColor)
		{
			if (combineColor != Color.White)
			{
				//We need to mix the palette and drawlist colors
				Vector3 vectColor = drawlistColor.ToVector3() * combineColor.ToVector3();
				Color finalColor = new Color(vectColor);
				finalColor.A = drawlistColor.A; //use the alpha value from the drawlist color
				return finalColor;
			}
			else
			{
				return drawlistColor;
			}
		}

		/// <summary>
		/// Render this textured quad
		/// </summary>
		public void Render(Color drawlistColor, IRenderer renderer, float scale)
		{
			renderer.Draw(
				Image,
				Position,
				FinalColor(drawlistColor, PrimaryColor),
				Rotation,
				Flip,
				scale);
		}

		#endregion
	}<commit_msg>getting ready for new shader<commit_after>using Microsoft.Xna.Framework;
using RenderBuddy;

namespace DrawListBuddy
{
	/// <summary>
	/// objects used to sort images in a draw list before they are actually rendered
	/// </summary>
	public class Quad
	{
		#region Properties

		public ITexture Image { get; private set; }

		public Vector2 Position { get; private set; }

		public float Rotation { get; private set; }

		public bool Flip { get; private set; }

		/// <summary>
		/// Get or set the layer to render at
		/// </summary>
		public int Layer { get; private set; }

		public Color PrimaryColor { get; private set; }

		public Color SecondaryColor { get; private set; }

		/// <summary>
		/// The position of this wuad in the drawlist, quads added later have higher number
		/// If two quads have the same layer, the QuadSort uses this number to sort them out
		/// </summary>
		/// <value>The list position.</value>
		public int ListPosition { get; private set; }

		#endregion //Properties

		#region Methods

		public Quad()
		{
		}

		/// <summary>
		/// hello, standard constructor!
		/// </summary>
		/// <param name="image">the id of teh bitmap for this quad</param>
		/// <param name="position">the position to render the upper left at</param>
		/// <param name="primaryColor">the color to tint this quad</param>
		/// <param name="secondaryColor"></param>
		/// <param name="rotation">the amount to rotate this image</param>
		/// <param name="flip">whether or not this image is flipped</param>
		/// <param name="layer">the layer to render the bitmap at</param>
		/// <param name="listPos"></param>
		public Quad(ITexture image,
			Vector2 position, 
			Color primaryColor,
			Color secondaryColor,
			float rotation, 
			bool flip, 
			int layer,
			int listPos)
		{
			Initialize(image, position, primaryColor, secondaryColor, rotation, flip, layer, listPos);
		}

		/// <summary>
		/// Set all the items of this quad
		/// </summary>
		/// <param name="image">the id of teh bitmap for this quad</param>
		/// <param name="position">the position to render the upper left at</param>
		/// <param name="primaryColor">the color to tint this quad</param>
		/// <param name="secondaryColor"></param>
		/// <param name="rotation">the amount to rotate this image</param>
		/// <param name="flip">whether or not this image is flipped</param>
		/// <param name="layer">the layer to render the bitmap at</param>
		/// <param name="listPos"></param>
		public void Initialize(ITexture image, 
			Vector2 position,
			Color primaryColor,
			Color secondaryColor,
			float rotation,
			bool flip,
			int layer,
			int listPos)
		{
			Image = image;
			Position = position;
			Rotation = rotation;
			Flip = flip;
			Layer = layer;
			PrimaryColor = primaryColor;
			SecondaryColor = secondaryColor;
			ListPosition = listPos;
		}

		/// <summary>
		/// Given a drawlist color and the palette swap color, get the final color to use
		/// </summary>
		/// <returns>The color to drwa the image</returns>
		/// <param name="drawlistColor">Drawlist color.</param>
		/// <param name="combineColor">the color to mix with the drawlist color</param>
		public Color FinalColor(Color drawlistColor, Color combineColor)
		{
			if (combineColor != Color.White)
			{
				//We need to mix the palette and drawlist colors
				Vector3 vectColor = drawlistColor.ToVector3() * combineColor.ToVector3();
				Color finalColor = new Color(vectColor);
				finalColor.A = drawlistColor.A; //use the alpha value from the drawlist color
				return finalColor;
			}
			else
			{
				return drawlistColor;
			}
		}

		/// <summary>
		/// Render this textured quad
		/// </summary>
		public void Render(Color drawlistColor, IRenderer renderer, float scale)
		{
			renderer.Draw(
				Image,
				Position,
				FinalColor(drawlistColor, PrimaryColor),
				FinalColor(drawlistColor, SecondaryColor),
				Rotation,
				Flip,
				scale);
		}

		#endregion
	}
{'fraction_non_alphanumeric': 0.12285201333675301, 'fraction_numerical': 0.001538856116953065, 'mean_word_length': 3.059864653826132, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7340278', 'n_tokens_mistral': 2661, 'n_tokens_neox': 2269, 'n_words': 810}