Difference between revisions of "User:AVS/Spellcasting"

From VCMI Project Wiki
Jump to: navigation, search
(Common interface)
(GUI related interface)
Line 31: Line 31:
 
* description for spellbook
 
* description for spellbook
 
* icon for spellbook, scroll etc.
 
* icon for spellbook, scroll etc.
 +
 +
=== OO design version with proxy ===
 +
 +
# SpellView - proxy class. Header file public.
 +
 +
# SpellViewHandler - singleton class (hidden) Header file private: used only by implementation of SpellView and CGI.
  
 
== Server interface ==
 
== Server interface ==

Revision as of 08:31, 17 January 2013

Common interface

Used by GUI, AI, (?) Server. Readonly.

Service-oriented design version

Use singleton Handler and methods accepion TSpell as first parameter.

  • (+) script-frendly
  • (+) low coupling

OO design version with proxy

  1. CSpellInfo - proxy class. Constructs from TSpell.
  • (+) more readable
  • (+) low coupling

OO design version

  1. CSpell -
  2. CSpellHandler
  • (+) current version
  • (-) higher coupling

GUI related interface

used by GUI

  • animation
  • sound
  • description for spellbook
  • icon for spellbook, scroll etc.

OO design version with proxy

  1. SpellView - proxy class. Header file public.
  1. SpellViewHandler - singleton class (hidden) Header file private: used only by implementation of SpellView and CGI.

Server interface

used by server-side handlers

  • applying effects
    • do damage
    • set timed effects
    • adv map logic