I have done a lot of research on this topic. I am trying to add objects to a hashset.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HashSet
{
class Program
{
class Brick
{
public int x1;
public int y1;
public int width1;
public int height1;
public int x2;
public int y2;
public int width2;
public int height2;
public bool Colliding()
{
if (x1 <= x2 + width2 && x1 + width1 >= x2 && y1 <= y2 + height2 && y1 + height1 >= y2)
{
return true;
}
return false;
}
}
static void Main(string[] args)
{
HashSet<Brick> bricks = new HashSet<Brick>();
for (int i=0; i<=640; i+=80)
{
bricks.Add(new Brick());
}
}
}
}