예제 #1
0
        public void CreateFarmItem(ConsumableFarmItemController farmItemController)
        {
            ConsumableFarmItem farmItem = FarmingGameController.GetItemStats(farmItemController.Type);

            _farmCell.SetConsumableFarmItem(farmItem);
            Instantiate(farmItemController, transform).Initiazliation(farmItem);
        }
예제 #2
0
        public bool AddFarmItem(Vector2Int coordinates, ConsumableFarmItem item)
        {
            if (!CoordinatesInGrid(coordinates) ||
                !_grid[coordinates.x * _gridSize.x + coordinates.y].IsEmpty)
            {
                return(false);
            }

            _grid[coordinates.x * _gridSize.x + coordinates.y] = new FarmCell(coordinates, item);

            return(true);
        }
예제 #3
0
 public void SetConsumableFarmItem(ConsumableFarmItem item)
 {
     _cellItem = item;
     _isEmpty  = false;
 }
예제 #4
0
 public FarmCell(int x, int y, ConsumableFarmItem item = null)
 {
     _coordinates = new Vector2Int(x, y);
     _cellItem    = item;
     _isEmpty     = item == null;
 }
예제 #5
0
 public FarmCell(Vector2Int coordinate, ConsumableFarmItem item = null)
 {
     _coordinates = coordinate;
     _cellItem    = item;
     _isEmpty     = item == null;
 }
예제 #6
0
 public void CreateFarmItem(ConsumableFarmItemController farmItemController, ConsumableFarmItem farmItem)
 {
     Instantiate(farmItemController, transform).Initiazliation(farmItem);
 }