Developing TicToe HTML5/Implementing Client Entities: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann No edit summary |
imported>Hendrik Brummermann No edit summary |
||
| Line 30: | Line 30: | ||
In the later live game, Marauroa has to create the objects based on the information it gets from the server. In order to store the prototpyes it has a factory called marauroa.rpobjectFactory. |
In the later live game, Marauroa has to create the objects based on the information it gets from the server. In order to store the prototpyes it has a factory called marauroa.rpobjectFactory. |
||
As a first step, we setup our inheritance hierarchy. Entity is the class at the root. Gameboard, Token and Player are specializations |
As a first step, we setup our inheritance hierarchy by defining prototypes. Entity is the class at the root. Gameboard, Token and Player are specializations of it. |
||
<source lang=" |
<source lang="javascript"> |
||
/** Abstract entity */ |
/** Abstract entity */ |
||
marauroa.rpobjectFactory.entity = marauroa.util.fromProto(marauroa.rpobjectFactory._default); |
marauroa.rpobjectFactory.entity = marauroa.util.fromProto(marauroa.rpobjectFactory._default); |
||
| Line 45: | Line 45: | ||
marauroa.rpobjectFactory.player = marauroa.util.fromProto(marauroa.rpobjectFactory.entity); |
marauroa.rpobjectFactory.player = marauroa.util.fromProto(marauroa.rpobjectFactory.entity); |
||
</source> |
</source> |
||
== Drawing the gameboard == |
|||
{{TODO|write this subsection}} |
|||