官术网_书友最值得收藏!

Summary

In this chapter, we have demystified a lot of programming concepts in a quick refresher. We also started learning about our first design pattern, the Singleton, which is intended to allow us to always have access to a class's functions and variables due to the fact that there will only ever be one of these objects.

We discussed some of the typical downfalls of using the Singleton pattern, such as the possibility that objects could have multiple copies of them in the future, even if this is unlikely.

We learned about three different kinds of method for creating Singletons, starting off with the Singleton, then extending it and templating parts of it to create the curiously reoccurring template pattern, and then we saw a final all-static version of getting the same effect with minimal hassle.

Each of these methods has their own pros and cons, and we hope that you use them effectively, where they are relevant. Now that we've touched on the design pattern everyone is familiar with, we can move towards our next challenge: learning about how to deal with logic that is specific to each of our inpidual games.

主站蜘蛛池模板: 休宁县| 乌恰县| 肇庆市| 皋兰县| 西盟| 皋兰县| 阿克陶县| 吴忠市| 揭西县| 长岛县| 宽城| 兴仁县| 高邮市| 桃园县| 岚皋县| 潼南县| 宁陵县| 翁牛特旗| 凉山| 龙口市| 壤塘县| 肇州县| 永寿县| 大渡口区| 扬州市| 修文县| 明水县| 开平市| 玉树县| 东阳市| 潮安县| 甘肃省| 搜索| 浮梁县| 萨嘎县| 古浪县| 龙井市| 郸城县| 龙海市| 滕州市| 永春县|