假设你在写一个计算机游戏。它的角色(你的对象)的行为方式非常复杂:在地图上行走,收集物品,执行目标,与其他角色对话,杀死某人,拯救他人。假设你已经将所有对象划分为 20 个类别。这就意味着,如果你够幸运的话,你就只需要 20 个类来定义对象。但有个问题:这些对象有多少种不同形式的交互。每种类型的对象都可以与其他 20 种对象进行互动(我们还计算出相同类型对象的互动)。换句话说,你要编写 20 x 20 = 400 次交互的代码!如果这种唯一类型对象的数量不是 20,而是 100,那么交互的数量可能是 10000! 这段话我没太读懂 谁能帮我理解下,谢谢!thanks Suppose you are writing a computer game. The behavior of its character (your object) is very complex: walking on the map, collecting items, executing targets, communicating with other characters, killing someone, and saving others. Assuming you have divided all objects into 20 categories. This means that if you are lucky enough, you only need 20 classes to define objects. But there is a question: how many different forms of interaction these objects have. Each type of object can interact with 20 other objects (we also calculated the interaction of objects of the same type). In other words, you need to write code with 20 x 20=400 interactions! If the number of objects of this unique type is not 20, but 100, then the number of interactions may be 10000! I didn't quite understand this passage. Can anyone help me understand it? Thank you! thanks