Click or drag to resize

IGridTCell, TPoint Interface

The base class of all types of grids. Grids are similar to 2D arrays.Elements in the grid are called _cells_.Grids support random access to cells through grid points(IGridPoint), using square bracket syntax. Cell cell = squareGrid[squarePoint]; Most grids support enumeration of points, making it possible to use[LINQ](http://msdn.microsoft.com/en-us/library/bb397926.aspx) on grids as well. foreach(var point in grid) doSomethingWithCell(grid[point]); var pointsThatSatsifyPointPredicate = grid.Where(pointPredicate); General algorithms are provided in Algorithms. If you want to implement your own grid, you can implement th is interface to have your grid work with many grid algorithms.

Namespace:  Gamelogic.Grids
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(1, 0, 0)]
public interface IGrid<TCell, TPoint> : IGrid<TPoint>, 
	IGridSpace<TPoint>, IEnumerable<TPoint>, IEnumerable
where TPoint : Object, IGridPoint<TPoint>

Type Parameters

TCell
TPoint

The IGridTCell, TPoint type exposes the following members.

Properties
  NameDescription
Public propertyItem
Accesses a cell in the given point.
Public propertyCode exampleValues
A enumerable containing all the values of this grid.
Top
Methods
  NameDescription
Public methodCloneStructureTNewCell
Returns a grid with exactly the same structure, but potentially holding elements of a different type.
(Inherited from IGridTPoint.)
Public methodContains
Returns whether a point is inside the grid.
(Inherited from IGridSpaceTPoint.)
Public methodGetAllNeighbors
Returns the neighbors of this point, regardless of whether they are in the grid or not.
(Inherited from IGridTPoint.)
Public methodGetEnumerator (Inherited from IEnumerableTPoint.)
Public methodGetLargeSet
This functions returns a large number of points around the origin. This is useful(when used with big enough n) to determine whether a grid that is missing points is doing so because of an incorrect test function, or an incorrect storage rectangle. Use for debugging.
(Inherited from IGridTPoint.)
Public methodGetStoragePoints
This method returns all points that can be contained by the storage rectangle for this grid. This is useful for debugging shape functions.
(Inherited from IGridTPoint.)
Top
Extension Methods
  NameDescription
Public Extension MethodButFirstTPoint
Returns an enumerable of all elements of the given list but the first, keeping them in order.
(Defined by CollectionExtensions.)
Public Extension MethodButLastTPoint
Returns an enumerable of all elements in the given list but the last, keeping them in order.
(Defined by CollectionExtensions.)
Public Extension MethodCombinationsTPoint
Generates all combinations of m elements selected from the list.
(Defined by Combinatorial.)
Public Extension MethodFilterByTypeTPoint, TFilter
Returns all elements of the source which are of FilterType.
(Defined by CollectionExtensions.)
Public Extension MethodListToStringTPoint
Returns a pretty string representation of the given list. The resulting string looks something like [a, b, c].
(Defined by CollectionExtensions.)
Public Extension MethodMaxByTPoint(FuncTPoint, IComparable)Overloaded.
Finds the maximum element in the source as scored by the given function.
(Defined by CollectionExtensions.)
Public Extension MethodMaxByTPoint, TKey(FuncTPoint, TKey)Overloaded.
Finds the minimum element in the source as scored by its projection.
(Defined by CollectionExtensions.)
Public Extension MethodMaxByTPoint, TKey(FuncTPoint, TKey, IComparerTKey)Overloaded.
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
(Defined by CollectionExtensions.)
Public Extension MethodMinByTPoint, TKey(FuncTPoint, TKey)Overloaded.
Finds the minimum element in the source as scored by its projection.
(Defined by CollectionExtensions.)
Public Extension MethodMinByTPoint, TKey(FuncTPoint, TKey, IComparerTKey)Overloaded.
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
(Defined by CollectionExtensions.)
Public Extension MethodPartitionsTPoint
Returns a list of all the partitions of a list.
(Defined by Combinatorial.)
Public Extension MethodPermutationsTPoint
Generates all permutations of the list of elements.
(Defined by Combinatorial.)
Public Extension MethodPowerSetTPoint
Returns the power set of the input, that is, the set of all subsets of the input.
(Defined by Combinatorial.)
Public Extension MethodRandomItemTPointOverloaded.
Returns a random element from a source.
(Defined by CollectionExtensions.)
Public Extension MethodRandomItemTPoint(IRandom)Overloaded.
Returns a random element from a source.
(Defined by CollectionExtensions.)
Public Extension MethodRotateLeftTPoint
Returns a enumerable with elements in order, but the first element is moved to the end.
(Defined by CollectionExtensions.)
Public Extension MethodRotateRightTPoint
Returns a enumerable with elements in order, but the last element is moved to the front.
(Defined by CollectionExtensions.)
Public Extension MethodSampleRandomTPoint(Int32)Overloaded.
Returns a random sample from a source.
(Defined by CollectionExtensions.)
Public Extension MethodSampleRandomTPoint(Int32, IRandom)Overloaded.
Returns a random sample from a source.
(Defined by CollectionExtensions.)
Public Extension MethodTakeHalfTPoint
Returns the first half of elements from a source.
(Defined by CollectionExtensions.)
Public Extension MethodTakeLastTPoint
Returns the last n elements from a source.
(Defined by CollectionExtensions.)
Public Extension MethodToPeriodicGeneratorTPoint (Defined by GeneratorExtensions.)
Public Extension MethodToRandomElementGeneratorTPoint (Defined by GeneratorExtensions.)
Public Extension MethodTuplesTPoint (Defined by Combinatorial.)
Top
See Also