User:AVS/Battle Mechanics Redesign

From VCMI Project Wiki
Jump to: navigation, search

Main abstractions

Action

Actor (player, AI) request. (Current Battle::ActionType, BattleAction)

  • [Todo] Move all serializable data into packets. (Should be client only.)
  • [Todo] (?) Separate factories for GUI client and AI. Client`s variants handles also GUI-related logic.
    • [Todo] hierarchy. Functional branch - Attack, Defend etc. Scope branch: AIAction, ClientAction. Leaf classes with 2 parents for each branch.

Factory instantiates leaf class, passes to environment as base from Scope Branch (may be subscription or visitor pattern for client-side logic), then returns as Functional branch object.


Effect

Result of request. Server side class. Descendants encapsulate all battle logic such as damage, movement, timed effects.

  • JSON-serializable: used as configuration for spell effects

Links