By the end of this chapter, you will understand how to create and use classes. A class is a collection of both variables and functions in a single C# object. Classes are an essential building block in modern games and, more widely, in object-oriented programming.
Classes combine functionality and data. Another way to put this is that classes are composed of both functions and variables, which when used within a class are called methods and fields, respectively. Classes are often used to represent objects in the world of your game project. For example, consider a character in a standard roleplaying game. There are several fields (or variables) that she might have:
string name; ...