Difference between revisions of "User:AVS/Spellcasting"
From VCMI Project Wiki
< User:AVS
(→OO design version with proxy) |
|||
Line 1: | Line 1: | ||
− | == Common interface | + | = Entities = |
+ | == Caster == | ||
+ | # Hero | ||
+ | # Creature | ||
+ | # (*) Scriptable virtual. Fully customizable by scripts. | ||
+ | |||
+ | ISpellCaster - public interface. | ||
+ | |||
+ | == Target == | ||
+ | # Object - any object in adv map. (f.e. scuttle boat). | ||
+ | # (?)Tile - any tile on map (f.e. DD) | ||
+ | # Battle creature | ||
+ | # Battle obstacle | ||
+ | # Battle hex | ||
+ | # (*) Battle hero. | ||
+ | |||
+ | * there can be multiple targets. | ||
+ | * on adv map, if no target then it assumed hero itself (f.e. vision, viewXXX ). | ||
+ | * (->) target selection configuration use selector semantic similar to bonus system. | ||
+ | |||
+ | ISpellTarger - public interface. | ||
+ | |||
+ | == Spell == | ||
+ | |||
+ | = Common interface = | ||
Used by GUI, AI, (?) Server. Readonly. | Used by GUI, AI, (?) Server. Readonly. | ||
− | + | == Service-oriented design version == | |
− | Use singleton Handler and methods | + | Use singleton Handler and methods accepting TSpell as first parameter. |
* (+) script-frendly | * (+) script-frendly | ||
* (+) low coupling | * (+) low coupling | ||
− | + | == OO design version with proxy == | |
# CSpellInfo - proxy class. Constructs from TSpell. | # CSpellInfo - proxy class. Constructs from TSpell. | ||
Line 16: | Line 40: | ||
* (+) low coupling | * (+) low coupling | ||
− | + | == OO design version == | |
# CSpell - | # CSpell - | ||
Line 24: | Line 48: | ||
* (-) higher coupling | * (-) higher coupling | ||
− | + | = GUI related interface = | |
used by GUI | used by GUI | ||
Line 32: | Line 56: | ||
* icon for spellbook, scroll etc. | * icon for spellbook, scroll etc. | ||
− | + | == OO design version with proxy == | |
# SpellView - proxy class. Header file public. | # SpellView - proxy class. Header file public. | ||
# SpellViewHandler - singleton class (hidden) Header file private: used only by implementation of SpellView and CGI. | # SpellViewHandler - singleton class (hidden) Header file private: used only by implementation of SpellView and CGI. | ||
− | + | = Server interface = | |
used by server-side handlers | used by server-side handlers | ||
Revision as of 08:54, 17 January 2013
Contents
Entities
Caster
- Hero
- Creature
- (*) Scriptable virtual. Fully customizable by scripts.
ISpellCaster - public interface.
Target
- Object - any object in adv map. (f.e. scuttle boat).
- (?)Tile - any tile on map (f.e. DD)
- Battle creature
- Battle obstacle
- Battle hex
- (*) Battle hero.
- there can be multiple targets.
- on adv map, if no target then it assumed hero itself (f.e. vision, viewXXX ).
- (->) target selection configuration use selector semantic similar to bonus system.
ISpellTarger - public interface.
Spell
Common interface
Used by GUI, AI, (?) Server. Readonly.
Service-oriented design version
Use singleton Handler and methods accepting TSpell as first parameter.
- (+) script-frendly
- (+) low coupling
OO design version with proxy
- CSpellInfo - proxy class. Constructs from TSpell.
- (+) more readable
- (+) low coupling
OO design version
- CSpell -
- CSpellHandler
- (+) current version
- (-) higher coupling
used by GUI
- animation
- sound
- description for spellbook
- 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
used by server-side handlers
- applying effects
- do damage
- set timed effects
- adv map logic