Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stupid, Clever, or Both?

Name: Anonymous 2007-10-24 2:02

I'm doing some expert programming of a tile-based game in which tile classes have references to anonymous functions that return the proper image for that tile. I figure I might as well not duplicate these. Should I make these functions onymous or just have a picture function manager that lets me get at them easily? It would be dead simple to create onymous functions for them at runtime, but it makes me feel funny to do it.

Name: Anonymous 2009-11-28 10:02

>>38
The only 'fail' I see here is spelling Gary with two [i]r[/i]s.

Name: Anonymous 2009-11-28 11:15

>>40,41
The only ``fail'' I see here is your BBCODE failure.

Name: Anonymous 2010-11-28 16:16

Name: Anonymous 2011-02-04 11:35

Name: Anonymous 2013-04-20 17:59

Name: Anonymous 2013-04-20 19:14

Use an Enum class, e. g.

public enum Picture {
    PIC1 ("picture1.png"),
    PIC2 ("picture2.png");
   
    private String filename;
    private Picture(String f) {
        filename = f;
    }
   
    public String getFilename() {
        return filename;
    }
}

Name: Anonymous 2013-04-20 19:28

Another idea with anonymous functions:

public enum PictureProvider {
    TILE_BLACK {
        @Override
        public String getFilename() {
            String f;
            doSomething( ... );
            return f;
        }
    },
    TILE_WHITE {
        @Override
        public String getFilename() {
            String f;
            doSomethingElse( ... );
            return f;
        }
    };
   
    public abstract String getFilename();
}

Name: Anonymous 2013-04-20 23:41



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List