View Single Post
Old 15-03-2008, 14:48   #2
thebol
Senior Member
 
Iscritto dal: Dec 2000
Cittā: bologna
Messaggi: 1309
Quote:
Originariamente inviato da fek Guarda i messaggi
Questo e' il codice incriminato:

Codice:
    public static PlayFieldDescriptor createForPlayerOne(Engine engine)
    {
        // TODO: REFACTOR THIS: Remove all hard coded values. This code has to be data-driven
        // Place these values in a text file and create a PlayFieldDescriptor from there.
        return new PlayFieldDescriptor(
            new Point(20, 32),
            new Point(292, 32),
            new Point(291, 421),
            new Point(20, 224),
            WarningBox.createForPlayerOne(engine),
            CounterBox.createForPlayerOne(engine),
            CrushBox.getOriginForPlayerOne());
    }


    public static PlayFieldDescriptor createForPlayerTwo(Engine engine)
    {
        // TODO: REFACTOR THIS: Remove all hard coded values. This code has to be data-driven
        // Place these values in a text file and create a PlayFieldDescriptor from there.
        return new PlayFieldDescriptor(
            new Point(524, 32),
            new Point(476, 32),
            new Point(419, 421),
            new Point(524, 224),
            WarningBox.createForPlayerTwo(engine),
            CounterBox.createForPlayerTwo(engine),
            CrushBox.getOriginForPlayerTwo());
    }
Deve diventare qualcosa tipo:

Codice:
    public static PlayFieldDescriptor createForPlayerTwo(Engine engine)
    {
        return PlayFieldDescriptor.loadFrom(engine, "PlayerOne.txt");
    }
Chi se ne occupa?
non passerei engine, ma farei restituire le info che servono ai vari Box in maniera indipendete
thebol č offline   Rispondi citando il messaggio o parte di esso