Monsters design

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Spot the GoF pattern)
Line 3: Line 3:
 
[[image:Monsters.gif]]
 
[[image:Monsters.gif]]
  
== Design notes ==
+
>== Design notes ==
  
 
* This is an incomplete framework of classes that track the behaviour of ''Monster''s.  More types of ''Monster'' are expected to be added later.
 
* This is an incomplete framework of classes that track the behaviour of ''Monster''s.  More types of ''Monster'' are expected to be added later.
Line 17: Line 17:
 
* Constructors, getters and setters, and many methods have been omitted from the diagram.  Make reasonable assumptions where necessary and state them.
 
* Constructors, getters and setters, and many methods have been omitted from the diagram.  Make reasonable assumptions where necessary and state them.
  
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://apemylyfyqi.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://apemylyfyqi.co.cc CLICK HERE]=
 +
----
 +
</div>
  
 
== Spot the GoF pattern ==
 
== Spot the GoF pattern ==

Revision as of 06:33, 18 November 2010

This design appeared in the 2004 exam.

Monsters.gif

>== Design notes ==

  • This is an incomplete framework of classes that track the behaviour of Monsters. More types of Monster are expected to be added later.
  • The DarkPlaces in which Monsters live and the Humans on which they prey are also modelled.
  • EtherealMonsters are bodiless; they can walk through walls.
  • CorporealMonsters have bodies; they can bite().
  • A Demon can exist only by possessing some other monster. It takes over control of the possessed Monster.
  • A Mimic pretends to be another CorporealMonster. Usually, it just forwards messages to the original monster, but it can vary behaviour if it wants to.
  • A Vampire can change its style between behaving like a person and behaving like a bat.
  • A Lycan is a Human turned into a hairy Monster. When its fullmoon() method is invoked, it tries to hunt a Human and bite() him/her. The bite() of a Lycan turns the victim into another Lycan of the same type.
  • Monsters lurk in DarkPlaces: UnderBeds, in Wardrobes and Dungeons. If a Dungeon is a Labyrinth, it can have other Dungeons inside it, but it cannot if it is a Cavern.
  • Monsters and Humans can use an Explorer subclass to look around inside DarkPlaces.
  • Constructors, getters and setters, and many methods have been omitted from the diagram. Make reasonable assumptions where necessary and state them.

Spot the GoF pattern

Personal tools