E D R , A S I H C RSS

BackLinks search for "CommercialShip"

BackLinks of CommercialShip


Search BackLinks only
Display context of search results
Case-sensitive searching
  • MoreEffectiveC++/Techniques3of3
         이제, 마지막 문제에 직면했다. (맨날 마지막이라고 해서 이상하게 여길지 모르는데, 이번에는 가상 함수의 구현을 위한 디자인상의 어려움에 진짜 직면했다.) 충돌 처리 과정의 함수들을 호출할때, 지금까지 해온 모든 것 들은 상속을 하지 않을 경우 재대로 작동한다. 그렇지만, 우리가 개발하는 게임에서 군용 우주 비행선(military space ship)과, 상업용 우주 비행선(commercial space ship) 구분이 필요하다고 해보자. 그럼 이제 보이는데로, 상속 관계에 대하여 수정을 할수 있다. Item 33의 내용을 보고 유의해야 하고, CommercialShip과 MilitaryShip이 새로운 가상 클래스인 SpaceShip으로 상속한 완전한 클래스로 만들어야 하는 내용이 아래에 있다.
         상업용, 군용 ship이 어떤것과 충돌할때 동일한 행동을 한다고 가정하자. 그리고 나면, CommercialShip과 MilitaryShip이 추가되기 전과, 동일한 충돌 처리를 할수 있다. 특별히 만약 MilitaryShip 객체와 Asteroid가 충돌할때를 예상해 보면
Found 1 matching page out of 7544 total pages

You can also click here to search title.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
Processing time 0.0067 sec