﻿using Gamelogic.Grids;
using UnityEngine;

public class BlockCell : SpriteCell, IBlockCell
{
	public int width;
	public int height;

	public void ResetPosition()
	{
		float x = -(0.5f - width/2f)*Dimensions.x/width;
		float y = -(0.5f - height/2f)*Dimensions.y/height;

		Debug.Log(Dimensions);

		SpriteRenderer.transform.localPosition = new Vector3(x, y, 0);
	}

	public PointList<RectPoint> GetCover(RectPoint point)
	{
		var pointList = new PointList<RectPoint>();

		for (int i = 0; i < width; i++)
		{
			for (int j = 0; j < height; j++)
			{
				pointList.Add(point + new RectPoint(i, j));
			}
		}

		return pointList;
	}
}
