public void CreateFarmItem(ConsumableFarmItemController farmItemController) { ConsumableFarmItem farmItem = FarmingGameController.GetItemStats(farmItemController.Type); _farmCell.SetConsumableFarmItem(farmItem); Instantiate(farmItemController, transform).Initiazliation(farmItem); }
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); }
public void SetConsumableFarmItem(ConsumableFarmItem item) { _cellItem = item; _isEmpty = false; }
public FarmCell(int x, int y, ConsumableFarmItem item = null) { _coordinates = new Vector2Int(x, y); _cellItem = item; _isEmpty = item == null; }
public FarmCell(Vector2Int coordinate, ConsumableFarmItem item = null) { _coordinates = coordinate; _cellItem = item; _isEmpty = item == null; }
public void CreateFarmItem(ConsumableFarmItemController farmItemController, ConsumableFarmItem farmItem) { Instantiate(farmItemController, transform).Initiazliation(farmItem); }