25 lines
463 B
C#
25 lines
463 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Shelf
|
|
{
|
|
public int[,] Positions;
|
|
|
|
public Shelf(int rows,int columns)
|
|
{
|
|
Positions = new int[rows, columns];
|
|
}
|
|
|
|
public bool IsOccupied(int row, int column)
|
|
{
|
|
return Positions[row, column] == 1;
|
|
}
|
|
|
|
public void SetOccupied(int row, int column, bool occupied)
|
|
{
|
|
Positions[row, column] = occupied ? 1 : 0;
|
|
}
|
|
|
|
}
|