TAILIEUCHUNG - C for game programmers phần 10

Noel Llopis (Timonium, MD) là một kỹ sư phần mềm tại Ngày 1 Studios. Ông đã phát triển công nghệ cho các MechAssault trò chơi và hiện đang bận rộn nghiên cứu và triển khai thực hiện công nghệ cho các trò chơi sắp tới. Ông có một . | Chapter 15 Dealing with Large Projects 375 A project that is divided into several fairly independent subsystems has many advantages which we will see in more detail later in this chapter . One of the major benefits is the reduced physical dependencies between files on different subsystems. In particular if the subsystems use abstract interfaces or a facade patterns to hide their contents from the rest of the world then the only physical dependencies we need to worry about are the ones between files within the same subsystem which becomes much more manageable. Assuming that the problem is still due to too many include files the Pimpl pattern might help. Pimpl which stands for Private IMPLementation is also known as the Cheshire Cat pattern. Let s first look at an example of a situation that might be helped with a Pimpl. Consider a minor variation on our previous header file include include class GamePlayer class Gamecamera public GameEntity GamePlayer GetPlayer private GamePlayer m_pPlayer CameraLens m_lens The only difference from the previous Gamecamera header file is that now we show an extra member variable m iens which represents the camera lens that the camera is using. By default it can just be a totally transparent lens but we could use colored lenses to give the whole scene a specific tint a black and white lens to filter out all the color or even some sort of dynamic lens that we can use to flash the screen with red patterns whenever the player gets hit. Even better would be the ability to have multiple lenses at once but we are restricting ourselves to one in order to keep the example as simple as possible. A consequence of adding the m_lens variable to the header file is that now we are forced to include the header file that contains the declaration of the CameraLens class. We cannot just do a forward declaration because we are dealing with a full variable not just a pointer or a reference. The same .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.