- Declared in:
- MultiGridCell.h
- Conforms to:
- AppCell
The MultiGrid2d class is a grid of cells. If your cells do not need to do anything fancy, and if you are happy to use a Swarm list as your collection for each cell, then you can use MultiGridCell as the cell type in your MultiGrid2d. If you need a fancy type of cell, I urge you to build your "AppSpecificCell" as a subclass of MultiGridCell. You inherit the methods that do the grunt work, and then you add only the fancy ones to do your special things in your program.
Create the collection that will be used in this cell. If you don't want a Swarm List to be used, you must subclass and override this method.
Description forthcoming.
Tells the collection to destroy all items (drop them from memory)
Returns a pointer to the object at the indicated offset in the list
Just returns 0. If you need something that has substantive meaning, override it in your subclass.
Returns a pointer to the collection that this cell holds. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
Return the number of items in the cell's collection. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
Tells the collection to return a pointer to its first item
Tells the collection to return a pointer to its last item
Selects an item from the collection at random (all are equally likely) and returns a pointer to it. The item is not removed from the collection
Return the X coordinate at which the cell resides. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
Return the Y coordinate at which the cell resides. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
This method does nothing, because by default the cells don't have any values that need initializing. If you cells have values in them, be sure to override this!
insertItem will insert the new object into the beginning of the collection. If your collection is somehow special and does not allow items to be added at the first part, or if you want something else to happen when your object is inserted, then subclass and override.
Subclass must override this because Swarm Lists don't use keys. But some collections do need keys, so this method is here.
If one wants each item in the cell to perform a particular action, this is the way to do it. Just pass through a selector.
If one wants each item in the cell to perform a particular action, and method that is represented by the selector takes an additional argument, this is the way to do it. Just pass through a selector and the argument. The argument must be an object.
Removes the requested object from the collection.
Returns nil
if that object is not in
the list.
Removes all items from the collection. Returns
nil
if that object is not in the list.
Remove the Nth item, N=0,...,count-1, from the collection
Removes and returns the first item from the
collection. Returns nil
if the
collection has no items.
Removes and returns the last item from the
collection. Returns nil
if the
collection has no items.
Selects an item from the collection at random (all are equally likely) and removes it from the collection and returns it.
This tells the cell that its X coordinate is theX. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
This tells the cell that its coordinates are ( theX, theY). If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
This tells the cell that its Y coordinate is theY. If you build your application-specific cell as a sublcass from MultiGridCell, generally, you don't have to override this one.
Description forthcoming.
Description forthcoming.
- Declared in:
- MultiGridCell.h
Since we assume specific applications will need to customize the behavior of the cells, this protocol is used to assure our grid that the cells are good enough to get the job done.
Method summaryDescription forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.