using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;

public class MyUtils
{
    // Draws a tile in the given tileMap's position
    // The Tiles must be inside "assets/Resources/Tiles/"
    public static void drawTile(Tilemap tileMap, Vector3Int pos, string tileName)
    {
        tileMap.SetTile(pos, Resources.Load<Tile>("Tiles/Simple/" + tileName));
    }

    // Returns the center position (Lower right if not odd numbers)
    public static Vector2Int getRoomCenter(Vector3Int start, Vector2Int size)
    {
        return new Vector2Int(start.x + 1 + size.x / 2, start.y - 1 - size.y / 2);
    }

    public static Vector2Int getRoomCenterV2(Vector3Int start, Vector2Int size)
    {
        return new Vector2Int(start.x + size.x / 2, start.y + size.y / 2);
    }
}
