# HG changeset patch # User saiam # Date 1228789602 0 # Node ID 3ebcccc7ee440141c30b741ce202d5d1f136082c # Parent 94fbc2bd6641804503e5e29919edaf76cf191174 Simplified the architecture description a bit diff -r 94fbc2bd6641 -r 3ebcccc7ee44 doc/kishna.tex --- a/doc/kishna.tex Tue Dec 09 02:15:00 2008 +0000 +++ b/doc/kishna.tex Tue Dec 09 02:26:42 2008 +0000 @@ -113,24 +113,33 @@ experimented with. Weapon parameters are defined in \textit{src/Weapons.cc}. \section{Program architecture} -Execution starts in Application, which parses the command-line -arguments, and then invokes methods in Engine. Engine creates the -GameState, and then Graphics, SinglePlayer, NetworkServer or -NetworkClient objects. - -GameState contains PhysicsWorld, which inherits from Terrain and -contains a list of PhysicsObjects. +The program consists of four main parts: Graphics\&Input, GameState, +Network and Physics. Each part contains various classes the relations +show up in the doxygen generated documentation of the program. -GameState then contains Player objects and Projectile objects, both of -which inherit from PhysicsObject. +The program starts from Application class and it then starts Engine +which creates GameState, Graphics and different network related +things. Physics simulation is started when GameState is created. -Player objects have a list of Weapon objects, and can use these to -create Projectiles. Every Player also has a Rope object, which is in -itself a separate PhysicsObject, and is either folded away, being -thrown, or attached to the terrain. +GameState contains PhysicsWorld which inherits from Terrain and +contains a list of PhysicsObjects. GameState also contains Player and +Projectile objects which inherit from PhysicsObject (and are contained +in PhysicsWorld). -The network code is a bit more complicated, with several layers. +Player objects have a list of Weapon objects which they can use to +create Projectiles. Every Player also has a Rope object, which is a +separate PhysicsObject, and is either folded away, being thrown or +attached to the terrain. +Graphics and input are handled in their own classes. Graphics has an +Input object which contains InputHandler objects for various classes +of input. One such object is PlayerInput which affects the GameState's +LocalPlayer. Other object is GuiInput which just modifies what the GUI +look like on the client side. + +The network code is a bit complicated and has several layers. + +% Are these necessary? Can they be simplified. NetworkAddress and NetworkSocket are ClanLib's Socket/IPAddress types. NetworkPackets provide a mechanism to read/write values from/to a byte buffer, and NetworkBuffer is used for buffering socket I/O. @@ -160,10 +169,6 @@ NetworkClientLocalPlayer/NetworkClientRemotePlayer/NetworkClientProjectile objects when they are received from the server. -Graphics has an Input object, which contains InputHandler objects for -various classes of input, such as PlayerInput (which affects the -GameState's LocalPlayer), and GuiInput (which just modifies what the -GUI looks like on the client side). TODO: Replace the above with some nice diagram, and make the text more brief