Exemplo n.º 1
0
 public static void Allocate(this byte[,] fabric, FabricClaim claim)
 {
     for (var x = 0; x < claim.Height; x++)
     {
         for (var y = 0; y < claim.Width; y++)
         {
             fabric[claim.Left + x, claim.Top + y]++;
         }
     }
 }
Exemplo n.º 2
0
        public static bool IsOverAllocated(this byte[,] fabric, FabricClaim claim)
        {
            for (var x = 0; x < claim.Height; x++)
            {
                for (var y = 0; y < claim.Width; y++)
                {
                    if (fabric[claim.Left + x, claim.Top + y] != 1)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }