Talk:Code structure

From VCMI Project Wiki
Revision as of 09:57, 2 May 2010 by Tow dragon (talk | contribs) (Created page with 'A comments about additions to lib sections: * handling general game mechanics and related actions I think this statement makes the difference between server and lib in handling…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A comments about additions to lib sections:

  • handling general game mechanics and related actions

I think this statement makes the difference between server and lib in handling mechanics less clear. 'Server' is responsible for responding to any actions clients want to take, while lib just performs appropriate changes. Lib doesn't handle game mechanics in the meaning I understand it. When for example player wants to attack an enemy stack during a battle, clients asks server "I want this stack to attack that one". Server checks if it is allowed and calculates all necessary parameters of that action and tells the lib "Stack A moves to position B and attacks stack C dealing D damage. Stack C retaliates to stack A dealing E damage. Stack A dies.". Lib just updates gamestates of server and client to match these changes.