public bool CanPass(Vector2Int cell) { if (ServerController.IsCellInBounds(cell)) { return(_walkBlockerCount[cell.x, cell.y] == 0); } return(false); }
public TileObject[] GetObjects(int x, int y) { if (WasLoaded && ServerController.IsCellInBounds(x, y)) { return(_objects[x, y].ToArray()); } return(null); }
public void RemoveObject(int x, int y, TileObject obj) { if (WasLoaded && ServerController.IsCellInBounds(x, y)) { _objects[x, y].Remove(obj); Item item = obj as Item; if (item) { _itemStackCollection.Remove(item, new Vector2Int(x, y)); } } }
public void AddObject(int x, int y, TileObject obj) { if (WasLoaded && ServerController.IsCellInBounds(x, y)) { _objects[x, y].Add(obj); if (isServer) { Item item = obj as Item; if (item) { _itemStackCollection.Add(item, new Vector2Int(x, y)); } } } if (!WasLoaded) { Debug.Log("Detected attempt to registrate object before launching TileController. This can cause malfunctions"); } }