Chapter 23

Collections in C#

C# collections enable you to act on several similar things as a group. For example, you could store all of the enemy GameObjects in a List and loop over that List each frame to update all of their positions and states.

This chapter covers three important types of these collections in detail: Lists, arrays, and Dictionaries. By the end of this chapter, you will understand how these collection types work and which to use in various situations.

C# Collections

A collection is a group of objects that are referenced by a single variable. In regular life, collections would be things like a group of people, a pride of lions, a parliament of rooks, or a murder of crows. Just like these animal grouping terms, the collections ...

Get Introduction to Game Design, Prototyping, and Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.