54 lines
977 B
C#
54 lines
977 B
C#
|
using System;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace DefaultNamespace
|
|||
|
{
|
|||
|
public interface IGridCell
|
|||
|
{
|
|||
|
public int X { get; }
|
|||
|
public int Y { get; }
|
|||
|
public bool IsOccupied { get; }
|
|||
|
}
|
|||
|
|
|||
|
public class GridCell : IGridCell
|
|||
|
{
|
|||
|
private int _x;
|
|||
|
private int _y;
|
|||
|
private bool _isOccupied;
|
|||
|
private Vector2 _position;
|
|||
|
|
|||
|
public int X => _x;
|
|||
|
|
|||
|
public int Y => _y;
|
|||
|
public Vector2 Position => _position;
|
|||
|
|
|||
|
public bool IsOccupied => _isOccupied;
|
|||
|
|
|||
|
public GridCell(int x, int y)
|
|||
|
{
|
|||
|
_x = x;
|
|||
|
_y = y;
|
|||
|
_isOccupied = false;
|
|||
|
_position = new Vector2(_x, _y);
|
|||
|
Draw();
|
|||
|
}
|
|||
|
|
|||
|
void Draw()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public void Enter()
|
|||
|
{
|
|||
|
_isOccupied = true;
|
|||
|
}
|
|||
|
|
|||
|
public void Exit()
|
|||
|
{
|
|||
|
_isOccupied = false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public interface IGridManager
|
|||
|
{
|
|||
|
}
|
|||
|
}
|