/// <summary> /// Indexer to get the GridItem at the specified coordinates. /// </summary> /// <param name="coordinate"> The position at which the item should be set or gotten.. </param> /// <returns> The GridItem at the specified position. </returns> public GridItem this[InnerChunkGridCoordinate coordinate] { get { return(_items[CalculateIndex(coordinate.X, coordinate.Y)]); } set { var oldValue = this[coordinate]; _items[CalculateIndex(coordinate.X, coordinate.Y)] = value; OnGridItemChanged(this, new GridCoordinate(Position, coordinate), oldValue, value); } }
public GridCoordinate(ChunkCoordinate chunkCoordinate, InnerChunkGridCoordinate innerCoordinate) { X = (chunkCoordinate.X << Chunk.XGridCoordinateToChunkCoordinateBitShift) + innerCoordinate.X; Y = (chunkCoordinate.Y << Chunk.YGridCoordinateToChunkCoordinateBitShift) + innerCoordinate.Y; }