1) Generics make Java suck less.
code: |
List<Actor> armyOfLight = new ArrayList<Actor>();
for(Actor army_member : armyOfLight) {
...
}
|
No casting. No off-by-one errors. Awesome APIs for the data structure.
Quote:
'ActorFatcory@15443e54' for each actor
Yes, you're assigning an ActorFactory instead of an Actor.
code: |
armyOfLight[i] = new ActorFactory();
|
A factory pattern is typically used as:
code: |
ActorFactory my_factory = new ActorFactory();
...
my_actor = my_factory.get_new_actor();
|
But that only makes sense if creation of new instances involves processes outside of a typical constructor.