Refactoring Database Access in Marauroa: Difference between revisions

Content deleted Content added
imported>Hendrik Brummermann
imported>Kymara
use syntax highlighting of java source code
Line 36:
 
Imagine you want to subclass the CharacterDAO with your class SomeGameCharacterDAO:
<source lang="java">
public class SomeGameCharacterDAO extends CharacterDAO {
...
</source>
 
You simply register it as
<source lang="java">
DAORegistry.get().register(CharacterDAO.class, new SomeGameCharacterDAO());
</source>
Note: In the register call the first parameter is the parent class you want to replace.
 
Line 80 ⟶ 83:
 
The following diff shows the complete list of changes that were required to port JMaPacman. I think it may help you to get a feeling on how to adjust your own code.
<source lang="java">
 
public class MaPacmanRPRuleProcessor implements IRPRuleProcessor
{
Line 162 ⟶ 165:
}
}
</source>